This is an example of creating the AWS Organization, Aws Organizational Unit and AWS Account using cdk.
- WebStorm or any other IDE for TypeScript development
- A valid email (can be your root account one)
- without "+" in it
- provided by a provider supporting subaddressing which means supporting '+' email extension (Most providers such as gmail/google, outlook etc. support it. If you're not sure check this page "Address modifiers" column or send an email to yourself adding a plus extension such as
myname+test@myemaildomain.com
. if you receive it, you're good).
- A root AWS account and IAM account with programmatic access
- Node.js
- yarn
- awscli
-
Go to Create an AWS account and register Remember your 12-digit account number
-
Go to IAM console Add users with name
admin
Select AWS access type. Check Access key - Programmatic access and Password - AWS Management Console access -
Go to next: permissions Create Group with
Administrator
Attach policyAdministratorAccess
-
Skip next: tags Go to next: review Create your user
Remember your Access key ID, Secret access key and password
-
Configure your AWS CLI
aws configure
See also Configuration basics
-
Clone this repository
git clone git@github.com:pepperize/cdk-organizations-example.git
Install dependencies
yarn install
-
Export your management account number and email
export CDK_DEFAULT_ACCOUNT=<your account i.e. 123456789012> export DEFAULT_EMAIL=<your email>
Deploy the stack
yarn deploy