The cdk.json file tells the CDK Toolkit how to execute your app.
-
Rename the
cdk.context.example.jsonfile tocdk.context.jsonand replace all the values with predefined values for your stack (required). -
Run
yarn(recommended) ornpm install -
Run
yarn cdk deploy --profile profileNameto deploy the stack to your specified region. You can skip providing the profile name if it isdefault. You can learn about creating profiles using the aws-cli here. -
You will notice two stacks created, and one will be a nested stack that holds the EC2 instance and the parent stack the entire VPC setup.
yarn buildcompile typescript to jsyarn watchwatch for changes and compileyarn testperform the jest unit testsyarn cdk deploydeploy this stack to your default AWS account/regionyarn cdk diffcompare deployed stack with current stateyarn cdk synthemits the synthesized CloudFormation template