aws-cdk

Author and deploy AWS infrastructure with AWS CDK while resolving CloudFormation failures.

Updated May 12, 2026
One-click install
npx skills add https://github.com/mreferre/aws-agent-toolkit-skills --skill aws-cdk-mreferre
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aws-cdk
Source: https://github.com/mreferre/aws-agent-toolkit-skills/tree/main/.kiro/skills/aws-cdk
Command: npx skills add https://github.com/mreferre/aws-agent-toolkit-skills --skill aws-cdk-mreferre

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you author, deploy, and troubleshoot AWS infrastructure with AWS CDK while minimizing risky changes like accidental resource replacement and broken cross-stack references.

Core Features & Use Cases

  • CDK construct authoring and deployment workflow: Best practices for CDK app structure, bootstrapping, and safe deploy sequencing (synth → diff → deploy), including strict mode guidance.
  • Operational troubleshooting for common CDK failures: Root-cause oriented fixes for synth-time errors, credential/environment issues, asset bundling/publishing problems, and deploy-time CloudFormation failures.
  • Safe migration and refactoring patterns: Guidance for importing existing resources and refactoring constructs to prevent replacement (including logical ID stability and drift strategies).

Real-world example: You need to refactor a CDK stack to clean up constructs without replacing stateful resources, then import an existing S3 bucket and confirm there is no drift before promoting to production.

Quick Start

Use the aws-cdk skill to deploy your CDK stack by running synth with strict mode, reviewing the diff, and then deploying only after confirming no unintended replacements.

Frequently Asked Questions about aws-cdk

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

FAQPage Schema
How do I prevent accidental resource replacement when refactoring AWS CDK stacks?

To prevent accidental resource replacement during AWS CDK refactoring, preserve logical IDs and apply safe migration patterns. This ensures stateful resources are not destroyed and recreated, maintaining stack stability while restructuring constructs.

Why does my AWS CDK deploy fail with CloudFormation errors during the synth and deploy workflow?

AWS CDK deploy failures often stem from synth-time errors, credential issues, or asset bundling problems. Root-cause troubleshooting targets these specific CloudFormation failure points to unblock releases by validating bootstrapping and environment configurations.

What is the best way to import existing resources into an AWS CDK stack without causing drift?

Importing existing resources into AWS CDK requires using resource import patterns and running drift detection. This approach safely integrates external resources into your stack management while verifying configuration alignment before production promotion.

Can I use AWS CDK with TypeScript or Python for compliance scanning and strict deployments?

AWS CDK supports both TypeScript and Python for infrastructure authoring with strict synth and deploy modes. Compliance scanning integrates cdk-nag patterns to validate infrastructure against security rules before deployment.

How do I resolve broken cross-stack exports and deadlocks in AWS CDK?

Resolving broken cross-stack exports in AWS CDK involves managing cross-stack references carefully to prevent deadlocks. Proper construct refactoring preserves logical IDs and ensures stable dependencies across stacks during updates.

Does AWS CDK strict mode help catch infrastructure issues before deployment?

AWS CDK strict mode enforces validation during the synth phase, catching potential issues before deployment. Running synth with strict mode followed by diff review confirms no unintended replacements, ensuring safe infrastructure promotion.