AWS CDK Infrastructure as Code
April 16, 2023 ยท View on GitHub
The cdk.json file tells the CDK Toolkit how to execute your app.
.bincontains the entry point that orchestrates everythinglibcontains the stackstestcontains tests
Logical architecture

Physical architecture

Getting started
- Open repository in VS Code
- Install recommended extensions
- Install graphviz
- Copy
.env.templateto.envand fill in the values - Ensure the "Run and Debug" configuration in VS Code is set to "Deploy AWS" and hit F5
Generating physical architecture diagram
Ensure the "Run and Debug" configuration in VS Code is set to "Generate AWS Diagram" and hit F5, or execute npm run graph:local.
Useful commands
npm run build- Compile TypeScript to JavaScript and prepare for standalone deployment artifact inbuildfoldernpm run deploy:local- Deploy this stack using the values in.envnpm run deploy- Deploy this stack on a CI server, pulling values from the environmentnpm run diff:local- Compare deployed stack with current state using the values in.envnpm run diff- Compare deployed stack with current state on a CI server, pulling values from the environmentnpm run destroy:local- Deletes all deployed stacks using the values in.env