Some AWS CDK to spit out Cloudformation for building EC2 instances of Windows Active Directory
-
make sure you have the latest version of the CDK CLI installed.
-
make sure your AWK CLI credentials && profile are setup.
nano ~/.aws/credentials [default] aws_access_key_id = ############ aws_secret_access_key = ############
nano ~/.aws/config [default] region = <your region> output = json
-
install dependancies with npm
npm install
-
create an ssh key pair in AWS via the Management Console and save them to your AWS cli directory.
~/.aws/pems/<yourpemfile>
4.1. then give them the proper permissions
bash chmod 400 ~/.aws/pems/<yourpemfile>
-
Synthesize your CloudFormation Template a. default Synthesize as a log output
cdk synth --profile <yourprofile>
b. Synthesize your template to a .yaml file
cdk synth --profile <yourprofile> >> <yourfile.yaml>
-
Deploy your CloudFormation Stack
cdk deploy --profile <yourprofile>
-
Destroy your CloudFormation Stack
cdk destroy --profile <yourprofile>