Skip to content

Commit a31b09b

Browse files
AWS CDK Python Setup (#1071)
Co-authored-by: Aaron Powell <me@aaron-powell.com>
1 parent be6b400 commit a31b09b

2 files changed

Lines changed: 112 additions & 0 deletions

File tree

docs/README.skills.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to
3838
| [aspnet-minimal-api-openapi](../skills/aspnet-minimal-api-openapi/SKILL.md) | Create ASP.NET Minimal API endpoints with proper OpenAPI documentation | None |
3939
| [automate-this](../skills/automate-this/SKILL.md) | Analyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files, reconstructs the step-by-step workflow, and proposes automation at multiple complexity levels using tools already installed on the user machine. | None |
4040
| [autoresearch](../skills/autoresearch/SKILL.md) | Autonomous iterative experimentation loop for any programming task. Guides the user through defining goals, measurable metrics, and scope constraints, then runs an autonomous loop of code changes, testing, measuring, and keeping/discarding results. Inspired by Karpathy's autoresearch. USE FOR: autonomous improvement, iterative optimization, experiment loop, auto research, performance tuning, automated experimentation, hill climbing, try things automatically, optimize code, run experiments, autonomous coding loop. DO NOT USE FOR: one-shot tasks, simple bug fixes, code review, or tasks without a measurable metric. | None |
41+
| [aws-cdk-python-setup](../skills/aws-cdk-python-setup/SKILL.md) | 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. | None |
4142
| [az-cost-optimize](../skills/az-cost-optimize/SKILL.md) | Analyze Azure resources used in the app (IaC files and/or resources in a target rg) and optimize costs - creating GitHub issues for identified optimizations. | None |
4243
| [azure-deployment-preflight](../skills/azure-deployment-preflight/SKILL.md) | Performs comprehensive preflight validation of Bicep deployments to Azure, including template syntax validation, what-if analysis, and permission checks. Use this skill before any deployment to Azure to preview changes, identify potential issues, and ensure the deployment will succeed. Activate when users mention deploying to Azure, validating Bicep files, checking deployment permissions, previewing infrastructure changes, running what-if, or preparing for azd provision. | `references/ERROR-HANDLING.md`<br />`references/REPORT-TEMPLATE.md`<br />`references/VALIDATION-COMMANDS.md` |
4344
| [azure-devops-cli](../skills/azure-devops-cli/SKILL.md) | Manage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints. Use when working with Azure DevOps, az commands, devops automation, CI/CD, or when user mentions Azure DevOps CLI. | `references/advanced-usage.md`<br />`references/boards-and-iterations.md`<br />`references/org-and-security.md`<br />`references/pipelines-and-builds.md`<br />`references/repos-and-prs.md`<br />`references/variables-and-agents.md`<br />`references/workflows-and-patterns.md` |
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
name: aws-cdk-python-setup
3+
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.
4+
---
5+
# AWS CDK Python Setup Instructions
6+
7+
This skill provides setup guidance for working with **AWS CDK (Cloud Development Kit)** projects using **Python**.
8+
9+
---
10+
11+
## Prerequisites
12+
13+
Before starting, ensure the following tools are installed:
14+
15+
- **Node.js** ≥ 14.15.0 — Required for the AWS CDK CLI
16+
- **Python** ≥ 3.7 — Used for writing CDK code
17+
- **AWS CLI** — Manages credentials and resources
18+
- **Git** — Version control and project management
19+
20+
---
21+
22+
## Installation Steps
23+
24+
### 1. Install AWS CDK CLI
25+
```bash
26+
npm install -g aws-cdk
27+
cdk --version
28+
```
29+
30+
### 2. Configure AWS Credentials
31+
```bash
32+
# Install AWS CLI (if not installed)
33+
brew install awscli
34+
35+
# Configure credentials
36+
aws configure
37+
```
38+
Enter your AWS Access Key, Secret Access Key, default region, and output format when prompted.
39+
40+
### 3. Create a New CDK Project
41+
```bash
42+
mkdir my-cdk-project
43+
cd my-cdk-project
44+
cdk init app --language python
45+
```
46+
47+
Your project will include:
48+
- `app.py` — Main application entry point
49+
- `my_cdk_project/` — CDK stack definitions
50+
- `requirements.txt` — Python dependencies
51+
- `cdk.json` — Configuration file
52+
53+
### 4. Set Up Python Virtual Environment
54+
```bash
55+
# macOS/Linux
56+
source .venv/bin/activate
57+
58+
# Windows
59+
.venv\Scripts\activate
60+
```
61+
62+
### 5. Install Python Dependencies
63+
```bash
64+
pip install -r requirements.txt
65+
```
66+
Primary dependencies:
67+
- `aws-cdk-lib` — Core CDK constructs
68+
- `constructs` — Base construct library
69+
70+
---
71+
72+
## Development Workflow
73+
74+
### Synthesize CloudFormation Templates
75+
```bash
76+
cdk synth
77+
```
78+
Generates `cdk.out/` containing CloudFormation templates.
79+
80+
### Deploy Stacks to AWS
81+
```bash
82+
cdk deploy
83+
```
84+
Reviews and confirms deployment to the configured AWS account.
85+
86+
### Bootstrap (First Deployment Only)
87+
```bash
88+
cdk bootstrap
89+
```
90+
Prepares environment resources like S3 buckets for asset storage.
91+
92+
---
93+
94+
## Best Practices
95+
96+
- Always activate the virtual environment before working.
97+
- Run `cdk diff` before deployment to preview changes.
98+
- Use development accounts for testing.
99+
- Follow Pythonic naming and directory conventions.
100+
- Keep `requirements.txt` pinned for consistent builds.
101+
102+
---
103+
104+
## Troubleshooting Tips
105+
106+
If issues occur, check:
107+
108+
- AWS credentials are correctly configured.
109+
- Default region is set properly.
110+
- Node.js and Python versions meet minimum requirements.
111+
- Run `cdk doctor` to diagnose environment issues.

0 commit comments

Comments
 (0)