aws-cdk

Authors, deploys, and troubleshoots AWS CDK infrastructure in TypeScript or Python.

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/richardnroman/Synthetic-Data-Exchange-Licensing-Platform --skill aws-cdk-richardnroman
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: aws-cdk
Source: https://github.com/richardnroman/Synthetic-Data-Exchange-Licensing-Platform/tree/main/.agents/skills/aws-cdk
Command: npx skills add https://github.com/richardnroman/Synthetic-Data-Exchange-Licensing-Platform --skill aws-cdk-richardnroman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing and operating AWS CDK infrastructure involves many failure modes — cross-stack reference deadlocks, accidental resource replacement, credential and bootstrap errors, and synth-time module issues — that are hard to diagnose without deep platform knowledge. ## Core Features & Use Cases - Construct Authoring Guidance: Covers L1/L2/L3 construct selection, Mixins, escape hatches, cross-stack references, and testing with Template assertions. - Deployment Troubleshooting: Maps common CDK CLI and CloudFormation errors (DeployFailed, UPDATE_ROLLBACK_FAILED, deadly embrace, asset errors) to root causes and fixes. - Lifecycle Operations: Documents bootstrap, cdk-nag compliance, drift detection, resource import, cdk migrate, and safe refactoring without resource replacement. - Use Case: A deploy fails with "Export cannot be deleted as it is in use" — the Skill walks you through the three-deploy ReferenceStrength migration to resolve the cross-stack deadlock safely. ## Quick Start Ask the assistant to help you write, deploy, or debug a CDK stack, for example: "Help me fix this CDK deploy error and refactor my stack without replacing the DynamoDB table."

Frequently Asked Questions about aws-cdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix the CDK cross-stack reference deadly embrace error?▼

The deadly embrace occurs when removing an export still imported by another stack. Weaken the reference first using CrossStackReferences.of(resource).produce(ReferenceStrength.BOTH), then WEAK, then remove it — three separate deploys. A legacy two-deploy exportValue recipe exists for older CDK versions.

How do I refactor CDK constructs without replacing resources?▼

Use cdk refactor --unstable=refactor after deploying a clean baseline, changing only moves and renames with no property changes in the same deploy. Always run cdk diff first, and lock logical IDs of stateful resources with unit tests to prevent accidental replacement.

What is the difference between cdk diff and cdk drift?▼

cdk diff compares your local CDK app against the last deployed template, showing what a new deployment would change. cdk drift compares the deployed template against actual live resource state, revealing out-of-band changes made outside CDK.

Why does cdk synth fail with Cannot find module in TypeScript?▼

Run npx tsc --noEmit first: if it fails, the issue is your TS project (missing npm ci, wrong tsconfig paths, duplicate aws-cdk-lib). If it succeeds, check the app field in cdk.json — outDir mismatches, stale compiled .js files, or ts-node path alias issues are common causes.

Does this CDK guidance apply to raw CloudFormation, SAM, or Terraform?▼

No. The Skill explicitly excludes raw CloudFormation YAML/JSON, SAM, Terraform, Pulumi, and CI/CD beyond CDK Pipelines. It covers only CDK construct authoring, deployment workflows, and CDK-specific troubleshooting in TypeScript and Python.

How do I import existing AWS resources into a CDK stack?▼

Use cdk import interactively or with --resource-mapping for CI, or cdk deploy --import-existing-resources which matches resources by explicit physical names. For read-only references, use from* methods like Bucket.fromBucketName or Vpc.fromLookup.