Skip to content
Skillpedia
Deploy & cloud (DevOps)40k Β· #7071

aws-cdk-python-setup

What it does

This guide helps you set up your computer to build cloud projects using AWS CDK with Python. It shows you how to install necessary tools, create a new project, and prepare everything to start developing.

When to use it

  • βœ“When you want to start building cloud infrastructure with code.
  • βœ“If you already use Python and want to manage AWS resources.
  • βœ“When following tutorials that ask to set up an AWS CDK environment.

Skill link

https://github.com/github/awesome-copilot/blob/main/skills/aws-cdk-python-setup/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/aws-cdk-python-setup/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHow do I set up my computer to create an AWS CDK project in Python?”

5 new skills a week. 1 minute to read.

How it works

It checks if you have the right tools (Node.js, Python, AWS CLI) installed, shows how to install the AWS CDK, configure your AWS credentials, and create a new project with a Python virtual environment.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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

What is AWS CDK?

AWS CDK is a tool that lets you define your cloud infrastructure (like servers and databases) using programming languages you know, such as Python.

Do I need to know everything about AWS to use this?

No, the CDK simplifies the process. This guide focuses on preparing your environment to start using the CDK.

What is a Python virtual environment?

It's like an isolated box for your Python project, ensuring that the libraries used in it don't interfere with other installations on your computer.

Details

Original description by the author

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.

repo: github/awesome-copilot

Popularity

GitHub stars
40k
Ranking position
#7071
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills