From e528eb4a78652fbea24781dbc98205586f5dbb3d Mon Sep 17 00:00:00 2001 From: sanjay-rb Date: Wed, 18 Mar 2026 19:00:11 +0000 Subject: [PATCH] AWS CDK Python Setup --- docs/README.skills.md | 1 + skills/aws-cdk-python-setup/SKILL.md | 111 +++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 skills/aws-cdk-python-setup/SKILL.md diff --git a/docs/README.skills.md b/docs/README.skills.md index e0857e9b2..e94c782be 100644 --- a/docs/README.skills.md +++ b/docs/README.skills.md @@ -37,6 +37,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to | [aspire](../skills/aspire/SKILL.md) | Aspire skill covering the Aspire CLI, AppHost orchestration, service discovery, integrations, MCP server, VS Code extension, Dev Containers, GitHub Codespaces, templates, dashboard, and deployment. Use when the user asks to create, run, debug, configure, deploy, or troubleshoot an Aspire distributed application. | `references/architecture.md`
`references/cli-reference.md`
`references/dashboard.md`
`references/deployment.md`
`references/integrations-catalog.md`
`references/mcp-server.md`
`references/polyglot-apis.md`
`references/testing.md`
`references/troubleshooting.md` | | [aspnet-minimal-api-openapi](../skills/aspnet-minimal-api-openapi/SKILL.md) | Create ASP.NET Minimal API endpoints with proper OpenAPI documentation | None | | [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 | +| [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 | | [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 | | [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`
`references/REPORT-TEMPLATE.md`
`references/VALIDATION-COMMANDS.md` | | [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`
`references/boards-and-iterations.md`
`references/org-and-security.md`
`references/pipelines-and-builds.md`
`references/repos-and-prs.md`
`references/variables-and-agents.md`
`references/workflows-and-patterns.md` | diff --git a/skills/aws-cdk-python-setup/SKILL.md b/skills/aws-cdk-python-setup/SKILL.md new file mode 100644 index 000000000..90b5e4903 --- /dev/null +++ b/skills/aws-cdk-python-setup/SKILL.md @@ -0,0 +1,111 @@ +--- +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 +```bash +npm install -g aws-cdk +cdk --version +``` + +### 2. Configure AWS Credentials +```bash +# 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 +```bash +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 +```bash +# macOS/Linux +source .venv/bin/activate + +# Windows +.venv\Scripts\activate +``` + +### 5. Install Python Dependencies +```bash +pip install -r requirements.txt +``` +Primary dependencies: +- `aws-cdk-lib` — Core CDK constructs +- `constructs` — Base construct library + +--- + +## Development Workflow + +### Synthesize CloudFormation Templates +```bash +cdk synth +``` +Generates `cdk.out/` containing CloudFormation templates. + +### Deploy Stacks to AWS +```bash +cdk deploy +``` +Reviews and confirms deployment to the configured AWS account. + +### Bootstrap (First Deployment Only) +```bash +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.