
aws-cdk-python-setup
โ Officialโ 36,202by github ยท part of github/awesome-copilot
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment prerequisites, create new CDK projects, manage dependencies, and deploy to AWS.
This is the playbook your agent receives when the skill activates โ you don't need to read it to use the skill, but it's here to audit before installing.
AWS CDK Python Setup Instructions
This skill provides setup guidance for working with AWS CDK (Cloud Development Kit) projects using Python.
Development Workflow
Synthesize CloudFormation Templates
cdk synthGenerates cdk.out/ containing CloudFormation templates.
Deploy Stacks to AWS
cdk deployReviews and confirms deployment to the configured AWS account.
Bootstrap (First Deployment Only)
cdk bootstrapPrepares environment resources like S3 buckets for asset storage.
Best Practices
- Always activate the virtual environment before working.
- Run
cdk diffbefore deployment to preview changes. - Use development accounts for testing.
- Follow Pythonic naming and directory conventions.
- Keep
requirements.txtpinned for consistent builds.
npx skills add github/awesome-copilot --skill "aws-cdk-python-setup" --full-depthRun this in your project โ your agent picks the skill up automatically.
Prerequisites
Before starting, ensure the following tools are installed:
- Node.js โฅ 14.15.0 โ Required for the AWS CDK CLI
- Python โฅ 3.7 โ Used for writing CDK code
- AWS CLI โ Manages credentials and resources
- Git โ Version control and project management
Installation Steps
1. Install AWS CDK CLI
npm install -g aws-cdk
cdk --version2. Configure AWS Credentials
# Install AWS CLI (if not installed)
brew install awscli
# Configure credentials
aws configureEnter your AWS Access Key, Secret Access Key, default region, and output format when prompted.
3. Create a New CDK Project
mkdir my-cdk-project
cd my-cdk-project
cdk init app --language pythonYour project will include:
app.pyโ Main application entry pointmy_cdk_project/โ CDK stack definitionsrequirements.txtโ Python dependenciescdk.jsonโ Configuration file
4. Set Up Python Virtual Environment
# macOS/Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate5. Install Python Dependencies
pip install -r requirements.txtPrimary dependencies:
aws-cdk-libโ Core CDK constructsconstructsโ Base construct library
Troubleshooting Tips
If issues occur, check:
- AWS credentials are correctly configured.
- Default region is set properly.
- Node.js and Python versions meet minimum requirements.
- Run
cdk doctorto diagnose environment issues.
Licensed under MITโ you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub โ