mcpField
A
aws-solution-architect

aws-solution-architect

github.com/alirezarezvaniクラウド・DevOps28.9k1.6k 回インストール2 日前に更新
リポジトリ

aws-solution-architect について

aws-solution-architectは、スタートアップチーム向けのAWSアーキテクチャ設計スキルです。規模、予算、コンプライアンス要件に基づくパターン提案やIaCテンプレート生成に加え、コスト分析も行います。

主な機能

  1. 01要件に応じたAWSパターンの提案
  2. 02CloudFormationテンプレートの生成
  3. 03CDK TypeScriptの例を提示
  4. 04コスト分析と最適化案の提示
  5. 05デプロイ確認と障害調査の支援

活用シーン

  1. 01SaaSやモバイルバックエンドのAWS構成を設計
  2. 02選択した構成のインフラテンプレートを生成
  3. 03AWSの月額費用を確認して削減案を探す
  4. 04デプロイ後にスタック状態や失敗原因を確認

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/alirezarezvani/claude-skills --skill aws-solution-architect

インストール後、Claude Code で/aws-solution-architectを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

assets/
expected_output.json
sample_input.json
references/
architecture_patterns.md
best_practices.md
service_selection.md
scripts/
architecture_designer.py
cost_optimizer.py
serverless_stack.py

詳細

AWS ソリューションアーキテクト

スタートアップ向けに、拡張性と費用対効果に優れた AWS アーキテクチャを、Infrastructure as Code テンプレートを使って設計します。


ワークフロー

ステップ 1:要件の収集

アプリケーションの仕様を収集します。

- Application type (web app, mobile backend, data pipeline, SaaS)
- Expected users and requests per second
- Budget constraints (monthly spend limit)
- Team size and AWS experience level
- Compliance requirements (GDPR, HIPAA, SOC 2)
- Availability requirements (SLA, RPO/RTO)
ステップ 2:アーキテクチャの設計

アーキテクチャ設計ツールを実行して、パターンの推奨を取得します。

python scripts/architecture_designer.py --input requirements.json

出力例:

{
  "recommended_pattern": "serverless_web",
  "service_stack": ["S3", "CloudFront", "API Gateway", "Lambda", "DynamoDB", "Cognito"],
  "estimated_monthly_cost_usd": 35,
  "pros": ["Low ops overhead", "Pay-per-use", "Auto-scaling"],
  "cons": ["Cold starts", "15-min Lambda limit", "Eventual consistency"]
}

推奨パターンから選択します。

  • サーバーレス Web:S3 + CloudFront + API Gateway + Lambda + DynamoDB
  • イベント駆動型マイクロサービス:EventBridge + Lambda + SQS + Step Functions
  • 3 層構成:ALB + ECS Fargate + Aurora + ElastiCache
  • GraphQL バックエンド:AppSync + Lambda + DynamoDB + Cognito

各パターンの詳細な仕様については、references/architecture_patterns.md を参照してください。

検証チェックポイント: ステップ 3 に進む前に、推奨パターンがチームの運用成熟度とコンプライアンス要件に合致していることを確認します。

ステップ 3:IaC テンプレートの生成

選択したパターンの Infrastructure as Code を作成します。

# Serverless stack (CloudFormation)
python scripts/serverless_stack.py --app-name my-app --region us-east-1

CloudFormation YAML 出力例(主要なサーバーレスリソース):

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Parameters:
  AppName:
    Type: String
    Default: my-app

Resources:
  ApiFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: index.handler
      Runtime: nodejs20.x
      MemorySize: 512
      Timeout: 30
      Environment:
        Variables:
          TABLE_NAME: !Ref DataTable
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref DataTable
      Events:
        ApiEvent:
          Type: Api
          Properties:
            Path: /{proxy+}
            Method: ANY

  DataTable:
    Type: AWS::DynamoDB::Table
    Properties:
      BillingMode: PAY_PER_REQUEST
      AttributeDefinitions:
        - AttributeName: pk
          AttributeType: S
        - AttributeName: sk
          AttributeType: S
      KeySchema:
        - AttributeName: pk
          KeyType: HASH
        - AttributeName: sk
          KeyType: RANGE

API Gateway、Cognito、IAM ロール、CloudWatch ロギングを含む完全なテンプレートは、serverless_stack.py によって生成され、references/architecture_patterns.md でも参照できます。

CDK TypeScript のスニペット例(3 層構成パターン):

import * as ecs from 'aws-cdk-lib/aws-ecs';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as rds from 'aws-cdk-lib/aws-rds';

const vpc = new ec2.Vpc(this, 'AppVpc', { maxAzs: 2 });

const cluster = new ecs.Cluster(this, 'AppCluster', { vpc });

const db = new rds.ServerlessCluster(this, 'AppDb', {
  engine: rds.DatabaseClusterEngine.auroraPostgres({
    version: rds.AuroraPostgresEngineVersion.VER_15_2,
  }),
  vpc,
  scaling: { minCapacity: 0.5, maxCapacity: 4 },
});
ステップ 4:コストの確認

推定コストと最適化の機会を分析します。

python scripts/cost_optimizer.py --resources current_setup.json --monthly-spend 2000

出力例:

{
  "current_monthly_usd": 2000,
  "recommendations": [
    { "action": "Right-size RDS db.r5.2xlarge → db.r5.large", "savings_usd": 420, "priority": "high" },
    { "action": "Purchase 1-yr Compute Savings Plan at 40% utilization", "savings_usd": 310, "priority": "high" },
    { "action": "Move S3 objects >90 days to Glacier Instant Retrieval", "savings_usd": 85, "priority": "medium" }
  ],
  "total_potential_savings_usd": 815
}

出力には以下が含まれます。

  • サービス別の月額コストの内訳
  • 適正なリソースサイズの推奨
  • Savings Plans の活用機会
  • 月額の削減可能額
ステップ 5:デプロイ

生成されたインフラストラクチャをデプロイします。

# CloudFormation
aws cloudformation create-stack \
  --stack-name my-app-stack \
  --template-body file://template.yaml \
  --capabilities CAPABILITY_IAM

# CDK
cdk deploy

# Terraform
terraform init && terraform apply
ステップ 6:検証と障害への対応

デプロイを検証し、モニタリングを設定します。

# Check stack status
aws cloudformation describe-stacks --stack-name my-app-stack

# Set up CloudWatch alarms
aws cloudwatch put-metric-alarm --alarm-name high-errors ...

スタックの作成に失敗した場合:

  1. 失敗の理由を確認します。
    aws cloudformation describe-stack-events \
      --stack-name my-app-stack \
      --query 'StackEvents[?ResourceStatus==`CREATE_FAILED`]'
    
  2. CloudWatch Logs で Lambda または ECS のエラーを確認します。
  3. テンプレートまたはリソース設定を修正します。
  4. 再試行する前に、失敗したスタックを削除します。
    aws cloudformation delete-stack --stack-name my-app-stack
    # Wait for deletion
    aws cloudformation wait stack-delete-complete --stack-name my-app-stack
    # Redeploy
    aws cloudformation create-stack ...
    

よくある失敗の原因:

  • IAM 権限エラー → --capabilities CAPABILITY_IAM とロールの信頼ポリシーを確認します
  • リソース制限超過 → Service Quotas コンソールからクォータの引き上げをリクエストします
  • テンプレート構文が無効 → デプロイ前に aws cloudformation validate-template --template-body file://template.yaml を実行します

ツール

architecture_designer.py

要件に基づいてアーキテクチャパターンを生成します。

python scripts/architecture_designer.py --input requirements.json --output design.json

入力: アプリケーションの種類、規模、予算、コンプライアンス要件を含む JSON
出力: 推奨パターン、サービススタック、コスト見積もり、長所と短所

serverless_stack.py

サーバーレスの CloudFormation テンプレートを作成します。

python scripts/serverless_stack.py --app-name my-app --region us-east-1

出力: 以下を含む本番環境対応の CloudFormation YAML

  • API Gateway + Lambda
  • DynamoDB テーブル
  • Cognito ユーザープール
  • 最小権限の IAM ロール
  • CloudWatch ロギング
cost_optimizer.py

コストを分析し、最適化を提案します。

python scripts/cost_optimizer.py --resources inventory.json --monthly-spend 5000

出力: 以下に関する推奨事項

  • アイドル状態のリソースの削除
  • インスタンスの適正サイズへの変更
  • 予約キャパシティの購入
  • ストレージ階層の移行
  • NAT Gateway の代替手段

クイックスタート

MVP アーキテクチャ(月額 100 ドル未満)
Ask: "Design a serverless MVP backend for a mobile app with 1000 users"

Result:
- Lambda + API Gateway for API
- DynamoDB pay-per-request for data
- Cognito for authentication
- S3 + CloudFront for static assets
- Estimated: $20-50/month
スケーリングアーキテクチャ(月額 500~2000 ドル)
Ask: "Design a scalable architecture for a SaaS platform with 50k users"

Result:
- ECS Fargate for containerized API
- Aurora Serverless for relational data
- ElastiCache for session caching
- CloudFront for CDN
- CodePipeline for CI/CD
- Multi-AZ deployment
コスト最適化
Ask: "Optimize my AWS setup to reduce costs by 30%. Current spend: $3000/month"

Provide: Current resource inventory (EC2, RDS, S3, etc.)

Result:
- Idle resource identification
- Right-sizing recommendations
- Savings Plans analysis
- Storage lifecycle policies
- Target savings: $900/month
IaC の生成
Ask: "Generate CloudFormation for a three-tier web app with auto-scaling"

Result:
- VPC with public/private subnets
- ALB with HTTPS
- ECS Fargate with auto-scaling
- Aurora with read replicas
- Security groups and IAM roles

入力要件

アーキテクチャ設計のため、以下の詳細を入力してください。

要件説明例
アプリケーションの種類構築するものSaaS プラットフォーム、モバイルバックエンド
想定規模ユーザー数、リクエスト数/秒10k ユーザー、100 RPS
予算AWS の月額上限月額 500 ドルまで
チームの状況規模、AWS の経験開発者 3 人、中級
コンプライアンス規制要件HIPAA、GDPR、SOC 2
可用性稼働時間の要件99.9% SLA、1 時間の RPO

JSON 形式:

{
  "application_type": "saas_platform",
  "expected_users": 10000,
  "requests_per_second": 100,
  "budget_monthly_usd": 500,
  "team_size": 3,
  "aws_experience": "intermediate",
  "compliance": ["SOC2"],
  "availability_sla": "99.9%"
}

出力形式

アーキテクチャ設計
  • 根拠を含むパターンの推奨
  • サービススタック図(ASCII)
  • 月額コストの見積もりとトレードオフ
IaC テンプレート
  • CloudFormation YAML:本番環境対応の SAM/CFN テンプレート
  • CDK TypeScript:型安全なインフラストラクチャコード
  • Terraform HCL:マルチクラウド対応の設定
コスト分析
  • 現在の支出内訳と最適化の推奨事項
  • 優先度別(高/中/低)のアクションリストと実施チェックリスト

リファレンスドキュメント

ドキュメント内容
references/architecture_patterns.md6 つのパターン:サーバーレス、マイクロサービス、3 層構成、データ処理、GraphQL、マルチリージョン
references/service_selection.mdコンピューティング、データベース、ストレージ、メッセージングの選定マトリクス
references/best_practices.mdサーバーレス設計、コスト最適化、セキュリティ強化、スケーラビリティ

コメント