- Installation
# Install AWS CLI on CentOs >= 7
sudo dnf install awscli
# Create Default Profile to login with AWS CLI Tools
aws configure
# Install CDK and Required Tools
npm install -g aws-cdk
npm install -g ts-node
npm install -g esbuild
npm install -g jest
# Install yarn if you prefer it than npm
npm install -g yarn
- Create a Project
# On a New AWS Account you must to Add CDK Bootstrap packages. this is how it's done
cdk bootstrap --profile default
# Create CDK Application
cdk init app --language=typescript
######
# OR #
######
# In Vagrant machine on Windows Hosts
cdk init app --language=typescript --generate-only
yarn install --no-bin-links
- Apply Project
cdk synth
# Use '--profile default' Option With All cdk commands to can login with previous created profile
cdk deploy --profile default
- Destroy Project
# Use '--profile default' Option With All cdk commands to can login with previous created profile
cdk destroy --profile default
- Debugging
# Sometimes you need to debug the custom init script that you provide to create of EC2 Instance
aws ec2 get-console-output --instance-id i-09edc092e25b1500b --profile default