Provides AWS CDK TypeScript patterns for defining, validating, and deploying AWS infrastructure as code. Use when creating CDK apps, stacks, and reusable constructs, modeling serverless or VPC-based architectures, applying IAM and encryption defaults, or testing and reviewing `cdk synth`, `cdk diff`, and `cdk deploy` changes. Triggers include "aws cdk typescript", "create cdk app", "cdk stack", "cdk construct", "cdk deploy", and "cdk test".
Provides AWS CDK TypeScript patterns for defining, validating, and deploying AWS infrastructure as code. Use when creating CDK apps, stacks, and reusable constructs, modeling serverless or VPC-based architectures, applying IAM and encryption defaults, or testing and reviewing `cdk synth`, `cdk diff`, and `cdk deploy` changes. Triggers include "aws cdk typescript", "create cdk app", "cdk stack", "cdk construct", "cdk deploy", and "cdk test".
allowed-tools
Read, Write, Edit, Bash, Grep, Glob
AWS CDK TypeScript
Overview
Use this skill to build AWS infrastructure in TypeScript with reusable constructs, safe defaults, and a validation-first delivery loop.
When to Use
Use this skill when:
Creating or refactoring a CDK app, stack, or reusable construct in TypeScript
Choosing between L1, L2, and L3 constructs
Building serverless, networking, or security-focused AWS infrastructure
Wiring multi-stack applications and environment-aware deployments
Validating infrastructure changes with cdk synth, tests, cdk diff, and cdk deploy
cdk synth # Synthesize CloudFormation template
cdk diff # Compare deployed vs local changes
cdk deploy # Deploy stack(s) to AWS
cdk deploy --all # Deploy all stacks
cdk destroy # Tear down stack(s)
cdk ls# List all stacks in the app
cdk doctor # Check environment setup
5. Recommended Delivery Loop
Model the stack
Start with L2 constructs and extract repeated logic into custom constructs.
Run cdk synth
Checkpoint: synthesis succeeds with no missing imports, invalid props, missing context, or unresolved references.
If it fails: fix the construct configuration or context values, then rerun cdk synth.
Run infrastructure tests
Checkpoint: assertions cover IAM scope, stateful resources, and critical outputs.
If tests fail: update the stack or test expectations, then rerun the test suite.
Run cdk diff
Checkpoint: review IAM broadening, resource replacement, export changes, and deletes on stateful resources.
If the diff is risky: adjust names, dependencies, or RemovalPolicy, then rerun cdk diff.
Run cdk deploy
Checkpoint: the stack reaches CREATE_COMPLETE or UPDATE_COMPLETE.
If deploy fails: inspect CloudFormation events, fix quotas, permissions, export conflicts, or bootstrap issues, then retry cdk deploy.
Verify runtime outcomes
Confirm stack outputs, endpoints, alarms, and integrations behave as expected before moving on.