Creating an account and OU from the CLI

Follow these steps from the AWS CLI:

  1. We can create an AWS account from the CLI using the create-account subcommand, like so:
aws organizations create-account \--email awsseccookbook1@gmail.com \--account-name awsseccookbookchild1 \--profile awssecadmin

This should give us the following response:

  1. We can check the status of our request using the describe-create-account-status subcommand by providing the request ID we received in the previous step:
aws organizations describe-create-account-status \--create-account-request-id car-bb6f15308b7311e98b7112a0c7517226 \--profile awssecadmin

If the request ...

Get AWS Security Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.