This is a CDK demo buildt with TypeScript. The infrastructure we will built in this demo looks like this:
- this was built using node v18.17.1, use your prefered method to install node,
it may work on other node versions. I like to use nvm. With nvm you may:
nvm install v18 nvm use v18
- cdk cli is needed, once you have your node you can install it with:
npm install -g aws-cdk
- an aws account is required. the
aws-cli should be installed
If needed you can see the following docs about
opening a free AWS account,
and
how to get your AWS Programmatic Access.
Once you have the
aws
cli command installed, and an AWS API key you may configure your credentials like so:fill in your AWS access key and secret. Useaws configure
us-west-2
as your default region andjson
as your prefered output format - your favourite code editor. we're using vs-code
Final steps to get us up and running are:
git clone https://github.com/conrado/ec2-cdk.git
cd ec2-cdk
npm install
To ensure this code demo works, use the following three commands
cdk bootstrap # bootsraps CDK into Cloudformation on your AWS account
cdk deploy # deploy this stack to your AWS account
npm run test # perform the jest tests validating correct deployment