aws-cdk

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

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/dennisvink/yolomancer --skill aws-cdk-dennisvink
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-cdk
Source: https://github.com/dennisvink/yolomancer/tree/main/skills/aws/core-skills/aws-cdk
Command: npx skills add https://github.com/dennisvink/yolomancer --skill aws-cdk-dennisvink

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing and operating AWS CDK infrastructure involves many failure modes that are hard to diagnose: cross-stack reference deadlocks, accidental resource replacement from construct ID changes, stuck UPDATE_ROLLBACK_FAILED stacks, synth-time module errors, and drift caused by hotswap deployments. This Skill provides the operational knowledge to author constructs correctly, deploy safely, and recover from CDK and CloudFormation errors without data loss. ## Core Features & Use Cases - Safe Deployment Workflows: Enforces the synth → diff → deploy discipline, covers bootstrap setup, cdk-nag compliance checks, drift detection, and explains why hotswap and express mode must never reach production. - Troubleshooting Guides: Maps concrete error classes (DeployFailed, NoCredentials, CannotFindAsset, DependencyCycle, deadly embrace, UPDATE_ROLLBACK_FAILED) to root causes and step-by-step fixes. - Construct Patterns & Refactoring: Covers L1/L2/L3 selection, Mixins and escape hatches, cross-stack references, cdk import/migrate for existing resources, and cdk refactor to rename constructs without triggering resource replacement. - Use Case: A deployment fails with "Export cannot be deleted as it is in use". The Skill walks you through the three-deploy ReferenceStrength migration (BOTH → WEAK → remove) to break the deadlock safely. ## Quick Start Ask the assistant to help you write a CDK stack, run cdk diff before deploying, or diagnose a specific CDK or CloudFormation error message you are seeing.

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 deadly embrace cross-stack reference 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, deploying between each step. A legacy two-deploy exportValue recipe exists for older CDK versions.

How do I rename a CDK construct without replacing the resource?

Use cdk refactor --unstable=refactor after deploying a clean baseline, performing only moves and renames with no property changes. Alternatively, call overrideLogicalId on the L1 child to pin the original logical ID, and lock IDs with unit tests.

Can I use cdk deploy --hotswap or --express in production?

No. Hotswap bypasses CloudFormation and creates drift on purpose, while express mode skips stabilization waits and disables automatic rollback. Both are development-only; production deployments must use a standard cdk deploy with no speed flags.

Why does my CDK stack fail with UPDATE_ROLLBACK_FAILED?

The stack is wedged after a failed rollback, often from out-of-band resource deletion or IAM issues. Recover with cdk rollback $STACK, or cdk rollback $STACK --orphan <LogicalId> to skip a stuck resource, then diff, fix the root cause, and redeploy.

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

Use cdk import interactively or with --resource-mapping for CI, or run cdk deploy --import-existing-resources to match resources by explicit physical names. For converting whole stacks or templates to CDK code, use cdk migrate, which generates L1 constructs.

When should I not use this CDK skill?

It does not cover raw CloudFormation YAML/JSON, SAM, Terraform, or Pulumi, and CI/CD beyond CDK Pipelines is out of scope. Use built-in knowledge or specialized skills for those tools instead.