
Aws Cdk
Define and deploy AWS infrastructure as TypeScript CDK apps instead of hand-written CloudFormation.
Overview
AWS CDK is an agent skill most often used in Build (also Ship, Operate) that teaches the CDK app lifecycle, constructs, and synthesis so solo builders can deploy AWS stacks from code.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-cdkWhat is this skill?
- Covers full app lifecycle: construction → synthesis (`cdk synth`) → deployment (`cdk deploy`)
- Explains stacks, constructs, environments, context, assets, tokens, and Aspects
- Documents `cdk.out/` outputs: templates, manifest, construct tree, and bundled assets
- TypeScript-first patterns for `App`, stack `env`, and explicit `app.synth()`
- 5 lifecycle phases documented in the app lifecycle table (construction through deployment)
Adoption & trust: 781 installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need AWS resources in production but raw CloudFormation or console clicks do not scale with your agent-driven development workflow.
Who is it for?
Indie SaaS or API builders standardizing on AWS CDK with TypeScript who want the agent to follow canonical construct and lifecycle rules.
Skip if: Teams on Terraform-only workflows, pure serverless without AWS, or one-off console provisioning with no IaC repo.
When should I use this skill?
You are authoring or debugging AWS CDK apps, stacks, constructs, or deploy/synth output.
What do I get? / Deliverables
You can structure CDK apps, run synth and deploy confidently, and hand off stable stack patterns for CI/CD and ongoing infra changes.
- Correctly structured CDK stack code
- Understanding of synth output and deploy steps
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Infrastructure code lives in the build phase where backend and cloud resources are modeled before production rollout. CDK stacks express backend services, IAM, and integrations—the same shelf as API and server architecture work.
Where it fits
Scaffold a new API stack with env-bound account and region before writing application code.
Run synthesis and interpret `cdk.out` before the first production deploy from CI.
Add an Aspect or split stacks when production traffic requires resource policy changes.
How it compares
Use as procedural CDK reference alongside generic CloudFormation docs—not as a live MCP deploy bridge.
Common Questions / FAQ
Who is aws-cdk for?
Solo and indie builders shipping on AWS who model infrastructure in code and use AI coding agents during backend and deploy work.
When should I use aws-cdk?
During Build when defining stacks and constructs; during Ship when synthesizing templates and deploying; during Operate when adjusting stacks, contexts, or assets after launch.
Is aws-cdk safe to install?
Review the Security Audits panel on this Prism page for the parent developer-kit package; the skill is documentation-only and does not execute deploys by itself.
SKILL.md
READMESKILL.md - Aws Cdk
# AWS CDK Core Concepts ## Table of Contents - [App Lifecycle](#app-lifecycle) - [Stacks](#stacks) - [Constructs](#constructs) - [Environments](#environments) - [Context](#context) - [Assets](#assets) - [Tokens and Lazy Values](#tokens-and-lazy-values) - [Aspects](#aspects) --- ## App Lifecycle The CDK app lifecycle follows a predictable flow from code to deployed infrastructure: ``` Code → Construct Tree → Synthesis → CloudFormation Template → Deployment ``` ### Phases | Phase | Description | CLI Command | |-------|-------------|-------------| | **Construction** | Instantiate App, Stacks, Constructs | — | | **Preparation** | Mutate construct tree (Aspects run here) | — | | **Validation** | Validate construct configurations | — | | **Synthesis** | Generate CloudFormation templates + assets | `cdk synth` | | **Deployment** | Create/update CloudFormation stacks | `cdk deploy` | ```typescript import { App } from 'aws-cdk-lib'; const app = new App(); // Construction phase: define stacks and constructs new MyStack(app, 'MyStack', { env: { account: '123456789012', region: 'us-east-1' }, }); // Synthesis phase: generates cdk.out/ directory app.synth(); ``` ### Output Directory After `cdk synth`, the `cdk.out/` directory contains: ``` cdk.out/ ├── MyStack.template.json # CloudFormation template ├── manifest.json # Assembly manifest ├── tree.json # Construct tree └── asset.* # Bundled assets (Lambda code, Docker images) ``` --- ## Stacks A Stack is the unit of deployment — it maps 1:1 to a CloudFormation stack. ### Single Stack ```typescript import { Stack, StackProps } from 'aws-cdk-lib'; import { Construct } from 'constructs'; export class MyAppStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); // Define resources here } } ``` ### Multi-Stack Architecture ```typescript const app = new App(); const networkStack = new NetworkStack(app, 'Network', { env: { account: '123456789012', region: 'us-east-1' }, }); const appStack = new AppStack(app, 'App', { vpc: networkStack.vpc, env: { account: '123456789012', region: 'us-east-1' }, }); // Explicit dependency ensures correct deploy order appStack.addDependency(networkStack); ``` ### Stack Best Practices - Keep stacks under 500 resources (CloudFormation limit) - Group resources by lifecycle (network rarely changes, app changes often) - Use `terminationProtection: true` for production stacks - Export shared resources as public properties for cross-stack references --- ## Constructs Constructs are the building blocks of CDK apps. They form a tree hierarchy: App → Stack → Constructs. ### L1 Constructs (CloudFormation Resources) Direct 1:1 mapping to CloudFormation resource types. Prefixed with `Cfn`. ```typescript import * as s3 from 'aws-cdk-lib/aws-s3'; // Full control, no defaults new s3.CfnBucket(this, 'RawBucket', { bucketName: 'my-raw-bucket', versioningConfiguration: { status: 'Enabled' }, bucketEncryption: { serverSideEncryptionConfiguration: [{ serverSideEncryptionByDefault: { sseAlgorithm: 'AES256' }, }], }, }); ``` ### L2 Constructs (Curated) Higher-level abstractions with sensible defaults, helper methods, and grant patterns. ```typescript import * as s3 from 'aws-cdk-lib/aws-s3'; // Sensible defaults + helper methods const bucket = new s3.Bucket(this, 'DataBucket', { versioned: true, encryption: s3.BucketEncryption.S3_MANAGED, blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL, }); // Grant pattern — generates least-privilege IAM automatically bucket.grantRead(myLambdaFunction); ``` ### L3 Constructs (Patterns) Combine multiple L2 constructs into reusable architectural patterns. ```typescript import * as apigateway from 'aws-cdk-lib/aws-apigateway'; // Creates API Gateway + Lambda integration + IAM permissions new apigateway.LambdaRestApi(this, 'MyApi', { handler: myLambdaFunction,