aws-cdk-python-setup
它能做什么
这份指南可以帮你配置电脑环境,以便使用 Python 通过 AWS CDK 构建云端项目。它会告诉你如何安装必要的工具、创建新项目,并为开始开发做好准备。
适用场景
- ✓当你想用代码搭建云端基础设施时。
- ✓当你已经在使用 Python,并希望管理 AWS 资源时。
- ✓当你跟着教程配置 AWS CDK 环境时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/aws-cdk-python-setup/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我该如何在电脑上设置环境,用 Python 创建一个 AWS CDK 项目?”
每周 5 个新技能,1 分钟读完。
工作原理
它会先检查你是否已经安装了所需工具(Node.js、Python、AWS CLI),然后说明如何安装 AWS CDK、配置 AWS 凭证,并使用 Python 虚拟环境创建新项目。
技术内容(原始 SKILL.md)
作者在 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 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\activate
5. Install Python Dependencies
pip install -r requirements.txt
Primary dependencies:
aws-cdk-lib— Core CDK constructsconstructs— 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 diffbefore deployment to preview changes. - Use development accounts for testing.
- Follow Pythonic naming and directory conventions.
- Keep
requirements.txtpinned 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 doctorto diagnose environment issues.
常见问题
什么是 AWS CDK?
AWS CDK 是一个工具,让你可以用自己熟悉的编程语言(比如 Python)来定义云端基础设施,比如服务器和数据库。
我需要全面了解 AWS 才能使用这份指南吗?
不需要。CDK 简化了很多流程,这份指南只专注于帮你准备好开发环境。
什么是 Python 虚拟环境?
它就像是给你的 Python 项目准备的一个独立“盒子”,确保项目中使用的库不会和电脑上其他软件的安装互相干扰。
详情
作者的原始描述
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
热度
- GitHub 星标
- 40k
- 排名
- #7071
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。