🏗️aws-diagram
- プラグイン
- aws-dev-toolkit
- ソース
- GitHub で見る ↗
説明
説明文、既存のIaC、または会話のコンテキストから、MermaidまたはASCII形式のAWSアーキテクチャ図を生成します。 次のような場合に使用: ユーザーがアーキテクチャを視覚化したいとき。
原文を表示
Generate AWS architecture diagrams in Mermaid or ASCII from a description, existing IaC, or conversation context. Use when the user wants to visualize an architecture.
ユースケース
- ✓AWSアーキテクチャを視覚化したいとき
- ✓IaCからアーキテクチャ図を生成したいとき
- ✓会話のコンテキストからアーキテクチャを図示したいとき
本文(日本語訳)
AWSアーキテクチャ図を生成します。システム内のリクエスト/データフローを明確かつ読みやすく表現した図を作成してください。
プロセス
- ソースを判定する:
$ARGUMENTSに"from-iac"が含まれる場合: リポジトリをスキャンして IaC ファイル(CDK、Terraform、CloudFormation、SAM)を検索し、アーキテクチャをリバースエンジニアリングする- それ以外の場合:
$ARGUMENTSまたは会話のコンテキストに含まれる説明を使用する
- Mermaid 図(メイン)と ASCII フォールバックを生成する
- 自明でない記法には凡例を付ける
Mermaid 図のスタイル
リクエストフローには graph LR(左→右)、階層型アーキテクチャには graph TD(上→下)を使用する。
記法の規則
- ユーザー/クライアント: スタジアム形状
([User]) - AWS サービス: 矩形
[Service Name] - データベース: シリンダー形状
[(Database)] - キュー: 平行四辺形
[/Queue/] - 外部サービス: 二重枠
[[External API]] - サブグラフ: VPC・サブネット・論理境界ごとにグループ化
- 矢印: プロトコル/アクションをラベルで示す(例:
-->|HTTPS|、-->|async|)
例
graph LR
User([User]) -->|HTTPS| CF[CloudFront]
CF -->|HTTPS| ALB[ALB]
subgraph VPC
subgraph Public Subnet
ALB
end
subgraph Private Subnet
ECS[ECS Fargate]
ECS -->|TCP 5432| RDS[(Aurora PostgreSQL)]
ECS -->|TCP 6379| Redis[(ElastiCache Redis)]
end
end
ECS -->|HTTPS| S3[S3 Bucket]
ECS -->|SQS| Queue[/Processing Queue/]
Queue --> Lambda[Lambda Processor]
Lambda --> S3
ASCII フォールバック
Mermaid をレンダリングできない環境向け:
┌──────┐ ┌────────────┐ ┌─────┐
│ User │────>│ CloudFront │────>│ ALB │
└──────┘ └────────────┘ └──┬──┘
│
┌──────────────┴──────────────┐
│ VPC │
│ ┌─────────────┐ │
│ │ ECS Fargate │──> Aurora │
│ │ │──> Redis │
│ └──────┬──────┘ │
└─────────┼────────────────────┘
│
┌────┴────┐
│ SQS │──> Lambda ──> S3
└─────────┘
IaC からのリバースエンジニアリング
from-iac が指定された場合:
*.tf、*.ts(CDK)、template.yaml(SAM)、*.template.json(CFN)を glob で検索する- リソース、それらの関係、およびネットワーク設定を抽出する
- 図のノードとエッジにマッピングする
- セキュリティ上の懸念点(パブリックサブネット、オープンなセキュリティグループ等)を警告マーカーで強調する
出力
常に以下をすべて提供すること:
- Mermaid 図(
```mermaidコードブロック内) - ASCII フォールバック(
```コードブロック内) - フローの説明(リクエスト/データの経路を 1〜2 文で説明)
- 注記(前提とした仮定、セキュリティに関する所見)
原文(English)を表示
You are generating an AWS architecture diagram. Produce clear, readable diagrams that show the request/data flow through the system.
Process
- Determine the source:
- If
$ARGUMENTScontains "from-iac": scan the repo for IaC files (CDK, Terraform, CloudFormation, SAM) and reverse-engineer the architecture - Otherwise: use the description from
$ARGUMENTSor conversation context
- If
- Generate a Mermaid diagram (primary) and an ASCII fallback
- Include a legend for any non-obvious notation
Mermaid Diagram Style
Use graph LR (left-to-right) for request flows, graph TD (top-down) for hierarchical architectures.
Conventions
- Users/Clients: Stadium shape
([User]) - AWS Services: Rectangle
[Service Name] - Databases: Cylinder
[(Database)] - Queues: Parallelogram
[/Queue/] - External Services: Double-bordered
[[External API]] - Subgraphs: Group by VPC, subnet, or logical boundary
- Arrows: Label with protocol/action (e.g.,
-->|HTTPS|,-->|async|)
Example
graph LR
User([User]) -->|HTTPS| CF[CloudFront]
CF -->|HTTPS| ALB[ALB]
subgraph VPC
subgraph Public Subnet
ALB
end
subgraph Private Subnet
ECS[ECS Fargate]
ECS -->|TCP 5432| RDS[(Aurora PostgreSQL)]
ECS -->|TCP 6379| Redis[(ElastiCache Redis)]
end
end
ECS -->|HTTPS| S3[S3 Bucket]
ECS -->|SQS| Queue[/Processing Queue/]
Queue --> Lambda[Lambda Processor]
Lambda --> S3
ASCII Fallback
For environments that don't render Mermaid:
┌──────┐ ┌────────────┐ ┌─────┐
│ User │────>│ CloudFront │────>│ ALB │
└──────┘ └────────────┘ └──┬──┘
│
┌──────────────┴──────────────┐
│ VPC │
│ ┌─────────────┐ │
│ │ ECS Fargate │──> Aurora │
│ │ │──> Redis │
│ └──────┬──────┘ │
└─────────┼────────────────────┘
│
┌────┴────┐
│ SQS │──> Lambda ──> S3
└─────────┘
From IaC Reverse Engineering
When from-iac is specified:
- Glob for
*.tf,*.ts(CDK),template.yaml(SAM),*.template.json(CFN) - Extract resources, their relationships, and networking config
- Map to diagram nodes and edges
- Highlight any security concerns (public subnets, open SGs) with a warning marker
Output
Always provide:
- Mermaid diagram (in a ```mermaid code block)
- ASCII fallback (in a ``` code block)
- Flow description (1-2 sentences explaining the request/data path)
- Notes (any assumptions made, security observations)
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。