AWS CDK Patterns — InfraTales Hub
Every InfraTales architecture is built with CDK TypeScript. This hub collects the patterns, gotchas, and production-tested constructs.
AWS CDK TypeScript — Production Patterns
Every architecture on InfraTales is built with CDK TypeScript. Not because it is the only option, but because it is the right one for application-coupled infrastructure that needs to evolve with the codebase.
This hub collects the CDK patterns used across every post — the constructs, the multi-environment setup, and the gotchas that cost days to debug.
CDK Architecture Posts
- AWS CDK VPC Foundation: Multi-Environment Dev/Staging/Prod
- Multi-Region DR with CDK: 15-Minute RPO for Financial Systems
- Real-Time Location Tracking on AWS with CDK TypeScript
- Serverless Event Pipeline on AWS: CDK Architecture Series
- AWS Chaos Engineering Platform with CDK
- APM and Distributed Profiling with CDK
CDK Fundamentals Worth Knowing
Bootstrapping
cdk bootstrap creates an S3 bucket and ECR repo in each account/region. Run it once per account/region combo. It is not idempotent by default if you change the qualifier.
Constructs vs Stacks
A Construct is a reusable component. A Stack is a deployment unit. The mistake most teams make: putting everything in one Stack. When a Stack has 500 resources, deployments take 20 minutes and rollbacks are painful.
Environment-Specific Config
Never use process.env directly in CDK code. Define an interface, validate at synthesis time, and pass config through context or environment objects.
Asset Bundling
CDK bundles Lambda code at synthesis time using Docker. This is slow in CI. Use bundling.local to run esbuild locally when available.
Cross-Stack References
Avoid them when possible. They create hidden dependencies that make parallel deployments impossible and rollbacks complicated.
Coming Soon
- CDK construct library: reusable patterns from every InfraTales post
- CDK testing guide: unit tests that catch the IAM mistakes
- CDK vs Terraform: when to use which
Need help with your CDK architecture? Work with Rahul