aws-cdk-python-setup

โดย github

คู่มือการตั้งค่าและเริ่มต้นสำหรับการพัฒนาแอปพลิเคชัน AWS CDK (Cloud Development Kit) ใน Python ทักษะนี้ช่วยให้ผู้ใช้สามารถกำหนดค่าสภาพแวดล้อม…

npx skills add https://github.com/github/awesome-copilot --skill aws-cdk-python-setup

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.

Skills เพิ่มเติมจาก github

console-rendering
github
คำแนะนำสำหรับการใช้ระบบเรนเดอร์คอนโซลที่ใช้ struct tag ใน Go
official
github-pr-query
github
สอบถาม Pull Request บน GitHub อย่างมีประสิทธิภาพ พร้อมรองรับการกรองด้วยอาร์กิวเมนต์ jq
official
jqschema
github
ยูทิลิตี้ค้นพบสคีมา JSON ที่แยกข้อมูลโครงสร้างและประเภทจากข้อมูล JSON
official
gh-agent-session
github
ส่วนขยายเซสชันเอเจนต์ CLI ของ GitHub
official
gh-agent-task
github
ส่วนขยายงานตัวแทน GitHub CLI
official
github-copilot-agent-tips-and-tricks
github
เคล็ดลับและเทคนิคสำหรับการทำงานกับ Pull Requests ของ GitHub Copilot Agent
official
rust-coding-skill
github
Use this skill whenever editing `*.rs` files in the `rust/` SDK in order to write idiomatic, efficient, well-structured Rust code
official
ai-ready
github
ทำให้ repo ใดๆ พร้อมสำหรับ AI — วิเคราะห์โค้ดเบสของคุณและสร้าง AGENTS.md, copilot-instructions.md, ขั้นตอนการทำงาน CI, เทมเพลต issue และอื่นๆ ขุดรีวิว PR ของคุณ…
official