Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)40k · #7071

aws-cdk-python-setup

Skill này làm gì

Hướng dẫn này giúp bạn thiết lập máy tính để xây dựng dự án đám mây bằng AWS CDK với Python. Nó chỉ bạn cách cài các công cụ cần thiết, tạo dự án mới và chuẩn bị mọi thứ để bắt đầu phát triển.

Khi nào nên dùng

  • ✓Khi bạn muốn bắt đầu xây dựng hạ tầng đám mây bằng mã.
  • ✓Khi bạn đã dùng Python và muốn quản lý tài nguyên AWS.
  • ✓Khi làm theo các hướng dẫn yêu cầu thiết lập môi trường AWS CDK.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/aws-cdk-python-setup/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để thiết lập máy tính của tôi để tạo dự án AWS CDK bằng Python?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ kiểm tra xem bạn đã cài các công cụ cần thiết chưa (Node.js, Python, AWS CLI), chỉ cách cài AWS CDK, cấu hình thông tin xác thực AWS và tạo dự án mới với môi trường ảo Python.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.
Câu hỏi thường gặp

AWS CDK là gì?

AWS CDK là công cụ cho phép bạn định nghĩa hạ tầng đám mây (như máy chủ và cơ sở dữ liệu) bằng các ngôn ngữ lập trình bạn đã biết, như Python.

Tôi có cần biết mọi thứ về AWS để dùng công cụ này không?

Không, CDK đơn giản hóa quá trình. Hướng dẫn này tập trung vào việc chuẩn bị môi trường để bạn bắt đầu dùng CDK.

Môi trường ảo Python là gì?

Đó là một “hộp” biệt lập cho dự án Python, đảm bảo các thư viện của nó không xung đột với các thứ khác đã cài trên máy tính của bạn.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7071
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự