AWS CDK Patterns
AWS CDK patterns covering TypeScript constructs, L1/L2/L3 levels, project structure, custom constructs, aspects for security, testing, and infrastructure as code best practices.
- Difficulty
- intermediate
- Read time
- 1 min read
- Version
- v1.0.0
- Confidence
- established
- Last updated
Quick Reference
AWS CDK: Use L2 constructs for defaults, L1 for control. Structure: bin/ for app entry, lib/ for stacks/constructs. Separate stacks by lifecycle. Use Aspects for cross-cutting concerns (security, tagging). cdk-nag for compliance. Escape hatches via node.defaultChild for L1 access. Test with assertions module.
Use When
- AWS infrastructure as code
- CDK TypeScript projects
- Multi-stack AWS deployments
- Reusable AWS constructs
Skip When
- Terraform or Pulumi
- Azure Bicep
- CloudFormation directly
AWS CDK Patterns
AWS CDK patterns covering TypeScript constructs, L1/L2/L3 levels, project structure, custom constructs, aspects for security, testing, and infrastructure as code best practices.