本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)40k · #7071

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に貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/github/awesome-copilot/blob/main/skills/aws-cdk-python-setup/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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 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.
よくある質問

AWS CDK とは何ですか?

AWS CDK は、サーバーやデータベースなどのクラウドインフラを、Python など使い慣れたプログラミング言語で定義できるツールです。

このツールを使うには AWS のことをすべて知っている必要がありますか?

いいえ、CDK によって手順が簡単になります。このガイドは、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

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル