π A curated list of awesome AWS CDK TypeScript resources, libraries, tools, and patterns
Contents β’ Learning β’ Constructs β’ Patterns β’ Tools β’ Contributing
- Learning Resources
- Construct Libraries
- Patterns & Examples
- Tools & Utilities
- Project Templates
- TypeScript Specific
- Real-World Projects
- Best Practices
- Community & Support
- Migration & Upgrade Guides
- Performance & Optimization
- Troubleshooting & Debugging
- Plugins & Extensions
- Advanced Topics
- π AWS CDK Developer Guide - Official documentation
- π AWS CDK API Reference - TypeScript API documentation
- π AWS CDK Examples - Official TypeScript examples
- π CDK Workshop - Official hands-on TypeScript workshop
- π CDK Patterns - Serverless architecture patterns
- π CDK Day - Annual CDK conference with workshops
- π ECS Workshop with CDK - Container patterns with CDK
- π CDK Advanced Workshop - Advanced CDK patterns
- π Serverless Stack Tutorial - Full-stack serverless with CDK
- π CDK Pipelines Workshop - CI/CD with CDK
- π¬ AWS CDK Crash Course - FreeCodeCamp comprehensive tutorial
- π¬ CDK Day Recordings - Conference talks and deep dives
- π¬ AWS CDK TypeScript Masterclass - Complete Udemy course
- π¬ Complete Guide to AWS CDK - Tech with Lucy series
- π¬ CDK Patterns YouTube - Matt Coulter's pattern videos
- π The CDK Book - Comprehensive guide by Matthew Bonig
- π AWS CDK in Practice - Manning publication
- βοΈ Matt Coulter's Blog - CDK patterns and best practices
- βοΈ Thorsten Hoeger's Blog - Advanced CDK topics
- βοΈ AWS DevOps Blog CDK Posts - Official AWS blog posts
- π¦ aws-cdk-lib - Main CDK library (L1 & L2 constructs)
- π¦ @aws-cdk/aws-apigatewayv2-alpha - API Gateway v2 constructs
- π¦ @aws-cdk/aws-appsync-alpha - AppSync constructs
- π¦ @aws-cdk/aws-lambda-python-alpha - Python Lambda constructs
- π¦ cdk-patterns - Serverless architecture patterns
- π¦ aws-solutions-constructs - AWS Solutions Builder patterns
- π¦ cdk-monitoring-constructs - Monitoring and alerting constructs
- π¦ cdk-watchful - Automatic dashboards and alarms
- π¦ cdk-nag - Security and compliance checks
- π¦ aws-lambda-nodejs - Node.js Lambda with esbuild
- π¦ cdk-lambda-powertools - Lambda Powertools for TypeScript
- π¦ cdk-serverless-clamscan - Virus scanning for S3
- π¦ cdk-lambda-extensions - Lambda extensions constructs
- π¦ cdk-appsync-transformer - AppSync schema transformers
- π¦ cdk8s - CDK for Kubernetes
- π¦ cdk-ecs-codedeploy - Blue/Green deployments for ECS
- π¦ ecs-patterns - Common ECS patterns
- π¦ eks-blueprints - EKS cluster patterns
- π¦ cdk-docker-image-deployment - Deploy Docker images to ECR
- π¦ aws-glue-alpha - Glue constructs
- π¦ aws-kinesisanalytics-flink-alpha - Kinesis Analytics
- π¦ cdk-redshift-serverless - Redshift Serverless patterns
- π¦ cdk-athena-workgroup - Athena workgroups
- π¦ aws-datalake-factory - Data Lake patterns
- π¦ cdk-security-group - Type-safe security groups
- π¦ cdk-backup-plan - AWS Backup plans
- π¦ cdk-iam-floyd - Type-safe IAM policies
- π¦ cdk-secrets-manager - Secrets rotation
- π¦ cdk-sops-secrets - SOPS integration
- ποΈ Serverless API - API Gateway + Lambda
- ποΈ GraphQL API - AppSync + DynamoDB
- ποΈ Event-Driven Architecture - EventBridge patterns
- ποΈ Step Functions Workflow - State machines
- ποΈ SQS Lambda Processor - Queue processing
- ποΈ Static Website - S3 + CloudFront
- ποΈ Next.js App - SST Next.js deployment
- ποΈ Full-Stack App - React + API + Database
- ποΈ VPC Best Practices - VPC patterns
- ποΈ Transit Gateway - Network hub
- ποΈ PrivateLink - Private endpoints
- ποΈ CDK Pipelines - Self-mutating pipelines
- ποΈ GitHub Actions - CDK GitHub Actions
- ποΈ GitLab CI - GitLab integration
- ποΈ Control Tower - Account vending
- ποΈ Organizations - Multi-account setup
- ποΈ Cross-Account Roles - Cross-account access
- π οΈ Projen - Project generation and management
- π οΈ CDK Dia - Diagram generation
- π οΈ CDK Watch Mode - Hot reload deployments
- π οΈ CDK Diff - Stack diff tool
- π οΈ CDK Resource Import - Import existing resources
- π§ͺ CDK Assertions - Built-in testing framework
- π§ͺ cdk-test - Testing utilities
- π§ͺ Template Matcher - Template assertions
- π§ͺ LocalStack - Local AWS environment
- π§ͺ CDK Local - CDK with LocalStack
- β cdk-nag-linting - Best practice checks
- β cfn-lint - CloudFormation linting
- β cdk-validator-cfnguard - Policy validation
- β Checkov - Security scanning
- β KICS - Infrastructure scanning
- π° Infracost - Cost estimation
- π° AWS Cost Explorer - Cost reporting
- π° cdk-cost-estimation - Cost estimates
- π cdk-typescript-template - Basic template
- π cdk-monorepo-template - Monorepo structure
- π projen-cdk-template - Projen CDK apps
- π nx-aws-cdk - Nx monorepo plugin
- π turborepo-cdk - Turborepo template
- π AWS Organization Template - Multi-account setup
- π Landing Zone Template - Landing zone
- π Baseline Template - Security baseline
// Type-safe environment configuration
interface EnvironmentConfig {
account: string;
region: string;
vpc: {
cidr: string;
maxAzs: number;
};
}
class TypeSafeStack extends Stack {
constructor(scope: Construct, id: string, config: EnvironmentConfig) {
super(scope, id, {
env: {
account: config.account,
region: config.region,
}
});
// Use strongly typed config
}
}// Reusable generic construct
export class RestApi<T extends Record<string, any>> extends Construct {
public readonly api: IRestApi;
constructor(scope: Construct, id: string, props: RestApiProps<T>) {
super(scope, id);
// Implementation with type safety
}
}- π Dependency Injection - DI patterns
- π Aspect-Oriented Programming - Using CDK Aspects
- π Custom Resources - TypeScript custom resources
- π Factory Patterns - Construct factories
- π Builder Patterns - Fluent interfaces
// Recommended tsconfig.json for CDK projects
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["ES2020"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"declarationMap": true,
"inlineSourceMap": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"typeRoots": ["./node_modules/@types"]
},
"exclude": ["cdk.out", "node_modules"]
}- π Construct Hub - CDK construct discovery platform
- π Serverless Stack (SST) - Full-stack serverless framework
- π AWS Controllers for Kubernetes - Kubernetes controllers
- π Serverless Airline - Demo airline app
- π AWS Solutions Implementations - Production-ready solutions
- π Liberty Mutual - Large-scale CDK adoption
- π Convoy - Migration to CDK
- π Stedi - Serverless APIs
- π Carsales - CDK adoption journey
- π RENGA - Startup CDK usage
my-cdk-app/
βββ bin/ # CDK app entry points
βββ lib/ # Stack definitions
β βββ constructs/ # Custom constructs
β βββ stacks/ # Stack classes
β βββ shared/ # Shared utilities
βββ test/ # Unit tests
βββ scripts/ # Helper scripts
βββ config/ # Environment configs
βββ docs/ # Documentation
// Organize stacks by lifecycle and dependencies
export class NetworkStack extends Stack { }
export class DataStack extends Stack { }
export class ComputeStack extends Stack { }
export class MonitoringStack extends Stack { }- β Unit Tests - Test construct properties
- β Snapshot Tests - Catch unintended changes
- β Fine-Grained Assertions - Test specific resources
- β Integration Tests - Test deployed resources
- β Compliance Tests - Security and compliance checks
- π Use least-privilege IAM policies
- π Enable encryption at rest and in transit
- π Use Secrets Manager for sensitive data
- π Enable AWS CloudTrail logging
- π Implement resource tagging strategies
- π Use CDK Nag for compliance checking
- π‘ Use cost allocation tags
- π‘ Implement auto-scaling policies
- π‘ Use Spot instances where appropriate
- π‘ Set up billing alarms
- π‘ Regular cost reviews with Infracost
- π¬ CDK.dev Slack - Official CDK community Slack workspace
- π¬ AWS CDK GitHub Discussions - Ask questions and share ideas
- π¬ r/aws CDK posts - Reddit community discussions
- π¬ Stack Overflow CDK Tag - Q&A for CDK developers
- π¬ CDK on Discord - Real-time community chat
- π CDK Day - Annual global CDK conference
- π AWS Community Day - Local AWS events
- π CDK Meetups - Local CDK user groups
- π AWS re:Invent CDK Sessions - Annual conference sessions
- π€ Elad Ben-Israel - CDK creator
- π€ Matthew Bonig - CDK Book author
- π€ Matt Coulter - CDK Patterns creator
- π€ Adam Keller - AWS CDK team
- π€ Daniel Schroeder - Community constructs
- π CDK v1 to v2 Migration Guide - Official migration path
- π Breaking Changes Log - Version change tracking
- π TypeScript 4.x to 5.x - TypeScript upgrades
- π Node.js Version Support - Node version matrix
- π CloudFormation Include - Import existing templates
- π cdk migrate - Automated migration tool
- π Former2 - Generate CDK from existing resources
- π CFN to CDK Converter - Template conversion tool
- π CDKTF - CDK for Terraform
- π Terraform Import - Import Terraform state
- π AWS CDK vs Terraform - Comparison guide
- β‘ esbuild for Lambda - Fast bundling
- β‘ Asset Bundling - Optimize asset handling
- β‘ CDK Context Caching - Cache lookups
- β‘ Parallel Stack Deployments - Deploy multiple stacks
- β‘ Tree Shaking - Reduce bundle size
- π Lambda Provisioned Concurrency - Warm starts
- π Lambda Layers - Share dependencies
- π RDS Proxy - Connection pooling
- π CloudFront CDN - Edge caching
- π DynamoDB DAX - In-memory cache
- πΈ Serverless Aurora - Auto-scaling database
- πΈ S3 Intelligent Tiering - Automatic storage optimization
- πΈ Lambda ARM64 - 20% cost reduction
- πΈ Spot Instances - Discounted compute
- πΈ Graviton Instances - Better price/performance
// Issue: Stack too large (>50MB)
// Solution: Use asset bundling or split into multiple stacks
// Issue: Resource limit exceeded
// Solution: Request service quota increase
// Issue: Circular dependencies
// Solution: Use exportValue() and Fn.importValue()
const vpcId = vpc.exportValue('VpcId');
const importedVpc = ec2.Vpc.fromVpcAttributes(this, 'ImportedVpc', {
vpcId: Fn.importValue('VpcId')
});// Issue: Type inference fails
// Solution: Explicit type annotations
const bucket: s3.IBucket = new s3.Bucket(this, 'MyBucket', {
bucketName: 'my-bucket'
});
// Issue: Module not found
// Solution: Check node_modules and tsconfig paths- π CDK Doctor - Diagnose issues
- π CloudFormation Events - Watch deployment
- π X-Ray Tracing - Application debugging
- π CloudWatch Logs Insights - Log analysis
- π CDK Context - Debug context values
// Enable detailed CloudFormation logging
import { CfnOutput } from 'aws-cdk-lib';
new CfnOutput(this, 'StackName', {
value: this.stackName,
description: 'Current stack name for debugging'
});
// Enable CDK verbose output
// cdk deploy --verbose
// cdk diff --verbose- π AWS Toolkit for VS Code - CDK support in VS Code
- π AWS Toolkit for JetBrains - IntelliJ/WebStorm integration
- π CDK Snippets - Code snippets for VS Code
- π CloudFormation Linter - Template validation
- π cdk-dia - Generate architecture diagrams
- π aws-cdk-graph - Graph visualization
- π cdk8s-cli - Kubernetes manifest generation
- π cdktf-cli - Terraform CDK CLI
- π nx-cdk - Nx monorepo integration
- π turborepo-cdk - Turborepo integration
- π projen - Project scaffolding
- π yarn-plugin-cdk - Yarn workspaces
- π pnpm-workspace - pnpm monorepos
// Deploy to multiple regions
const usEast1App = new App();
new MyStack(usEast1App, 'MyStack-us-east-1', {
env: { region: 'us-east-1', account: '123456789012' }
});
const euWest1App = new App();
new MyStack(euWest1App, 'MyStack-eu-west-1', {
env: { region: 'eu-west-1', account: '123456789012' }
});import { CustomResource, CustomResourceProvider } from 'aws-cdk-lib';
// Create custom resource for unsupported AWS features
const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyResource', {
codeDirectory: './custom-resources',
runtime: Runtime.NODEJS_18_X,
policyStatements: [/* IAM permissions */]
});
new CustomResource(this, 'MyCustomResource', {
serviceToken: provider.serviceToken,
properties: {
key: 'value'
}
});import { IAspect, IConstruct, Tags } from 'aws-cdk-lib';
// Implement cross-cutting concerns
class TaggingAspect implements IAspect {
visit(node: IConstruct): void {
if (node instanceof Bucket) {
Tags.of(node).add('Environment', 'Production');
}
}
}
Aspects.of(app).add(new TaggingAspect());We welcome contributions! Please see our Contributing Guidelines for details.
- Must be TypeScript-specific or have excellent TypeScript support
- Active maintenance (commits within last 6 months)
- Clear documentation
- Adds value to the CDK TypeScript ecosystem
Built with β€οΈ by the CDK TypeScript community