🏗️iac-scaffold
- プラグイン
- aws-dev-toolkit
- 引数
- <framework> <project-description>
- ソース
- GitHub で見る ↗
説明
次のような場合に使用: 新しい IaC プロジェクトの作成、新規スタック/モジュールの追加、 または AWS インフラ向けデプロイメントパイプラインのセットアップ。 CDK、Terraform、SAM、または CloudFormation を使用して、 AWS の Infrastructure as Code プロジェクトの雛形を生成します。
原文を表示
Scaffold new AWS infrastructure-as-code projects using CDK, Terraform, SAM, or CloudFormation. Use when creating new IaC projects, adding new stacks/modules, or setting up deployment pipelines for AWS infrastructure.
ユースケース
- ✓新しいIaCプロジェクトを作成するとき
- ✓新規スタック/モジュールを追加するとき
- ✓AWSインフラ向けデプロイメントパイプラインをセットアップするとき
本文(日本語訳)
新しい AWS IaC プロジェクトのスキャフォールドを生成します。
フレームワーク: $ARGUMENTS[0](cdk / terraform / sam / cfn) 説明: $ARGUMENTS[1]
処理フロー
- フレームワークや説明が不明確な場合は、確認事項を質問する
aws-iacMCP ツールを使用して、リソース設定のバリデーションおよびセキュリティ問題のチェックを行うawsknowledgeMCP ツール(mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation、mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation、mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend)を使用して、選択したフレームワークの最新ベストプラクティスを調査する- templates/ 内のパターンに従ってプロジェクト構造を生成する
フレームワーク別ガイダンス
CDK(デフォルト: TypeScript)
cdk init app --language typescriptパターンを使用する- スタックはライフサイクル単位で分割する(ネットワーキング・データ・コンピューティング)
- コンプライアンスチェックには
cdk-nagを使用する - クロススタック参照には Outputs を活用する
Terraform
- サービスごとにモジュールを分割する構成にする
- リモートステートは S3 に保存し、DynamoDB でロック管理する
- 既存モジュールがある場合は
terraform-aws-modulesを使用する - 環境ごとに tfvars ファイルを分ける
SAM
template.yamlはルートディレクトリに配置する- Lambda の共通設定は Globals セクションにまとめる
- 高速な反復開発には SAM Accelerate を使用する
CloudFormation
- 再利用性のためにネストされたスタックを活用する
- ガードレールとして
AllowedValues付きの Parameters を定義する - マルチ環境テンプレートには Conditions を使用する
注意事項
- フレームワークに適した
.gitignoreを必ず含めること - CDK: シークレット情報を context に記載しないこと — SSM Parameter Store または Secrets Manager を使用すること
- Terraform:
.tfstateは絶対にコミットしないこと — 先にリモートバックエンドを設定すること - SAM:
sam localには Docker が必要 — README にその旨を明記すること - 全フレームワーク共通: 最低限
Environment・Project・Ownerのタグをすべてのリソースに付与すること - よく使うコマンド(deploy / destroy / diff / synth)をまとめた Makefile または justfile を含めること
出力内容
以下を含む完全なプロジェクト構造を生成します:
- エントリーポイント / メイン設定ファイル
- リソースの実装例(最低1つ)
- 環境別設定ファイル
- セットアップ手順を記載した README
- CI/CD パイプライン設定(デフォルトは GitHub Actions。異なる場合は確認する)
原文(English)を表示
Scaffold a new AWS IaC project.
Framework: $ARGUMENTS[0] (cdk, terraform, sam, or cfn) Description: $ARGUMENTS[1]
Process
- Ask clarifying questions if the framework or description is unclear
- Use the
aws-iacMCP tools to validate resource configurations and check for security issues - Use the
awsknowledgeMCP tools (mcp__plugin_aws-dev-toolkit_awsknowledge__aws___search_documentation,mcp__plugin_aws-dev-toolkit_awsknowledge__aws___read_documentation,mcp__plugin_aws-dev-toolkit_awsknowledge__aws___recommend) to look up current best practices for the chosen framework - Generate the project structure following the patterns in templates/
Framework-Specific Guidance
CDK (TypeScript default)
- Use
cdk init app --language typescriptpatterns - Separate stacks by lifecycle (networking, data, compute)
- Use
cdk-nagfor compliance checks - Outputs for cross-stack references
Terraform
- Module-per-service structure
- Remote state in S3 + DynamoDB locking
- Use
terraform-aws-moduleswhere they exist - Separate tfvars per environment
SAM
- template.yaml at root
- Globals section for shared Lambda config
- Use SAM Accelerate for fast iteration
CloudFormation
- Nested stacks for reuse
- Parameters with AllowedValues for guardrails
- Conditions for multi-environment templates
Gotchas
- Always include a
.gitignoreappropriate for the framework - CDK: don't put secrets in context — use SSM Parameter Store or Secrets Manager
- Terraform: never commit
.tfstate— configure remote backend first - SAM:
sam localneeds Docker — mention this in the README - All frameworks: tag everything with at minimum
Environment,Project,Owner - Include a Makefile or justfile with common commands (deploy, destroy, diff, synth)
Output
Generate the complete project structure with:
- Entry point / main config file
- At least one example resource
- Environment-specific configuration
- README with setup instructions
- CI/CD pipeline config (GitHub Actions default, ask if different)
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。