PluginBench
Skill
Official
Pass
Audit score 90

aws-cdk-python-setup

github/awesome-copilot

Setup and deploy AWS CDK applications in Python with guided environment configuration and project initialization.

What is aws-cdk-python-setup?

This skill provides step-by-step guidance for configuring AWS CDK development environments in Python, including prerequisite installation, project creation, dependency management, and deployment. Use it when starting a new CDK project or setting up a development machine for infrastructure-as-code work.

  • Install and configure AWS CDK CLI globally via npm
  • Set up AWS credentials and authentication through AWS CLI
  • Initialize new CDK Python projects with standard structure and dependencies
  • Activate Python virtual environments and install required packages
  • Synthesize CloudFormation templates from CDK code
  • Deploy infrastructure stacks to AWS accounts with change preview

How to install aws-cdk-python-setup

npx skills add https://github.com/github/awesome-copilot --skill aws-cdk-python-setup
Prerequisites
  • Node.js version 14.15.0 or higher
  • Python version 3.7 or higher
  • AWS CLI installed and available in PATH
  • Git for version control
  • Valid AWS account with access credentials
Claude Code
Cursor
Windsurf
Cline

How to use aws-cdk-python-setup

  1. 1.Install AWS CDK CLI globally using npm install -g aws-cdk and verify with cdk --version
  2. 2.Configure AWS credentials by running aws configure and entering your Access Key, Secret Key, region, and output format
  3. 3.Create a new CDK project directory and initialize it with cdk init app --language python
  4. 4.Activate the Python virtual environment using source .venv/bin/activate (macOS/Linux) or .venv\Scripts\activate (Windows)
  5. 5.Install Python dependencies with pip install -r requirements.txt
  6. 6.Run cdk bootstrap to prepare AWS environment resources on first deployment
  7. 7.Use cdk synth to generate CloudFormation templates and cdk deploy to deploy to AWS

Use cases

Good for
  • Setting up a new AWS CDK Python project from scratch on a development machine
  • Configuring AWS credentials and environment for the first time before CDK work
  • Initializing project structure with app.py and stack definitions for infrastructure code
  • Deploying infrastructure changes to AWS with cdk deploy after development
  • Diagnosing environment configuration issues using cdk doctor and troubleshooting steps
Who it's for
  • DevOps engineers setting up infrastructure-as-code pipelines
  • Python developers building AWS cloud infrastructure programmatically
  • Cloud architects implementing infrastructure automation
  • Teams establishing CDK development environments across multiple machines

aws-cdk-python-setup FAQ

What is the minimum Python version required?

Python 3.7 or higher is required for AWS CDK development.

Do I need to run cdk bootstrap every time I deploy?

No, cdk bootstrap only needs to run once per AWS account and region to prepare environment resources like S3 buckets.

How do I preview changes before deploying?

Run cdk diff to see the CloudFormation changes that will be applied before executing cdk deploy.

What should I do if deployment fails with credential errors?

Verify AWS credentials are correctly configured by running aws configure, check that your default region is set, and use cdk doctor to diagnose environment issues.

Can I use this skill with existing CDK projects?

Yes, you can use the setup steps to configure your environment and then work with existing projects by activating the virtual environment and installing dependencies.

Full instructions (SKILL.md)

Source of truth, from github/awesome-copilot.


name: aws-cdk-python-setup description: 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.

AWS CDK Python Setup Instructions

This skill provides setup guidance for working with AWS CDK (Cloud Development Kit) projects using Python.


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 --version

2. Configure AWS Credentials

# 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.

3. Create a New CDK Project

mkdir my-cdk-project
cd my-cdk-project
cdk init app --language python

Your project will include:

  • app.py — Main application entry point
  • my_cdk_project/ — CDK stack definitions
  • requirements.txt — Python dependencies
  • cdk.json — Configuration file

4. Set Up Python Virtual Environment

# macOS/Linux
source .venv/bin/activate

# Windows
.venv\Scripts\activate

5. Install Python Dependencies

pip install -r requirements.txt

Primary dependencies:

  • aws-cdk-lib — Core CDK constructs
  • constructs — Base construct library

Development Workflow

Synthesize CloudFormation Templates

cdk synth

Generates cdk.out/ containing CloudFormation templates.

Deploy Stacks to AWS

cdk deploy

Reviews and confirms deployment to the configured AWS account.

Bootstrap (First Deployment Only)

cdk bootstrap

Prepares environment resources like S3 buckets for asset storage.


Best Practices

  • Always activate the virtual environment before working.
  • Run cdk diff before deployment to preview changes.
  • Use development accounts for testing.
  • Follow Pythonic naming and directory conventions.
  • Keep requirements.txt pinned for consistent builds.

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 doctor to diagnose environment issues.