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


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

Every week: one AWS failure broken down + the fix that worked