
This walks you through the complete setup for AWS CDK with Python, from installing the CLI via npm to bootstrapping your first deployment. It covers the essentials: configuring AWS credentials, spinning up a new project with `cdk init`, managing the virtual environment, and the core commands like synth and deploy. The guide assumes you're starting fresh and need the prerequisite check (Node.js, Python, AWS CLI). Honestly, it's solid for first-timers who want a linear path from zero to deployed stack, though experienced CDK users will already know most of this. The troubleshooting section is brief but hits the common gotchas around credentials and versioning.
$ npx -y skills add github/awesome-copilot --skill aws-cdk-python-setup --agent claude-codeInstalls into .claude/skills of the current project.
This skill provides setup guidance for working with AWS CDK (Cloud Development Kit) projects using Python.
Before starting, ensure the following tools are installed:
npm install -g aws-cdk
cdk --version
# Install AWS CLI (if not installed)
brew install awscli
# Configure credentials
aws configure
Enter your AWS Access Key, Secret Access Key, default region, and output format when prompted.
mkdir my-cdk-project
cd my-cdk-project
cdk init app --language python
Your project will include:
app.py — Main application entry pointmy_cdk_project/ — CDK stack definitionsrequirements.txt — Python dependenciescdk.json — Configuration file# macOS/Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate
pip install -r requirements.txt
Primary dependencies:
aws-cdk-lib — Core CDK constructsconstructs — Base construct librarycdk synth
Generates cdk.out/ containing CloudFormation templates.
cdk deploy
Reviews and confirms deployment to the configured AWS account.
cdk bootstrap
Prepares environment resources like S3 buckets for asset storage.
cdk diff before deployment to preview changes.requirements.txt pinned for consistent builds.If issues occur, check:
cdk doctor to diagnose environment issues.Sponsors