MCP HubMCP Hub
スキル一覧に戻る

beanstalk-deploy

pr-pm
更新日 Today
49 閲覧
62
9
62
GitHubで表示
その他general

について

このスキルは、GitHub ActionsとPulumiを使用したAWS Elastic Beanstalkの本番環境対応デプロイメントパターンを提供します。堅牢なエラーハンドリング、インフラストラクチャの健全性検証、および終了済み環境などのエッジケース管理に重点を置いています。Beanstalkアプリケーションに対して適切なリトライロジックと状態クリーンアップを備えた信頼性の高いCI/CDパイプラインが必要な場合にご利用ください。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/pr-pm/prpm
Git クローン代替
git clone https://github.com/pr-pm/prpm.git ~/.claude/skills/beanstalk-deploy

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

AWS Elastic Beanstalk Deployment Best Practices

Apply these production-tested patterns when working with Elastic Beanstalk deployments, especially with GitHub Actions and Pulumi infrastructure.

🎯 Core Principles

  1. Always verify infrastructure health before deploying
  2. Never assume resources are ready - implement retry logic
  3. Handle terminated environments gracefully with state cleanup
  4. Use concurrency control to prevent deployment conflicts
  5. Pre-install dependencies for faster, more reliable deploys
  6. Implement comprehensive error handling with fallbacks

🏗️ Infrastructure Health Checks

ALWAYS check infrastructure status before deploying:

- name: Check infrastructure status
  run: |
    echo "🔍 Checking infrastructure status..."

    # Get environment name from Pulumi state (without deploying)
    EB_ENVIRONMENT_NAME=$(pulumi stack output ebEnvironmentName 2>/dev/null || echo "")

    if [ -z "$EB_ENVIRONMENT_NAME" ]; then
      echo "🔍 No environment found in Pulumi state. Will deploy infrastructure..."
    else
      echo "🔍 Checking environment status: $EB_ENVIRONMENT_NAME"

      # Check if environment exists and is healthy
      EB_ENV_STATUS=$(aws elasticbeanstalk describe-environments \
        --environment-names "$EB_ENVIRONMENT_NAME" \
        --query "Environments[0].Status" --output text 2>/dev/null || echo "NOT_FOUND")

      if [ "$EB_ENV_STATUS" = "Terminated" ] || [ "$EB_ENV_STATUS" = "NOT_FOUND" ]; then
        echo "⚠️  Environment is $EB_ENV_STATUS. Deleting from Pulumi state..."

        # Delete environment from Pulumi state
        EB_URN=$(pulumi stack --show-urns | awk '/aws:elasticbeanstalk\/environment:Environment/ {print $1; exit}')
        if [ -n "$EB_URN" ]; then
          echo "🔧 Deleting: $EB_URN"
          pulumi state delete "$EB_URN" --force
        fi

        echo "🔄 Infrastructure will be recreated..."
      else
        echo "✅ Environment exists: $EB_ENV_STATUS"

        # Check if infrastructure changes needed
        if pulumi preview --diff --expect-no-changes 2>/dev/null; then
          echo "✅ No infrastructure changes needed"
        else
          echo "🔄 Infrastructure changes detected"
        fi
      fi
    fi

Why: Prevents deploying to orphaned resources, automatically recovers from terminated environments, saves money on zombie resources.

⏳ Beanstalk Readiness Verification

ALWAYS wait for environment to be fully ready:

- name: Verify Elastic Beanstalk environment exists
  run: |
    echo "🔍 Verifying Elastic Beanstalk environment..."
    EB_ENVIRONMENT_NAME="${{ steps.get-resources.outputs.eb_environment_name }}"

    # Wait until environment exists
    echo "⏳ Waiting for environment to exist..."
    aws elasticbeanstalk wait environment-exists \
      --environment-names "$EB_ENVIRONMENT_NAME" || true

    # Wait until environment is Ready (with 30 retries)
    for i in {1..30}; do
      ENV_STATUS=$(aws elasticbeanstalk describe-environments \
        --environment-names "$EB_ENVIRONMENT_NAME" \
        --query "Environments[0].Status" --output text 2>/dev/null || echo "NOT_FOUND")
      ENV_HEALTH=$(aws elasticbeanstalk describe-environments \
        --environment-names "$EB_ENVIRONMENT_NAME" \
        --query "Environments[0].Health" --output text 2>/dev/null || echo "UNKNOWN")

      echo "⏳ EB Status: $ENV_STATUS, Health: $ENV_HEALTH (attempt $i/30)"

      if [ "$ENV_STATUS" = "Ready" ]; then
        echo "✅ Environment is Ready"
        break
      fi
      sleep 20  # Wait 20 seconds between checks (10 minutes total)
    done

    if [ "$ENV_STATUS" != "Ready" ]; then
      echo "⚠️  Environment not Ready after 10 minutes. Continuing with caution..."
    fi

Why: Prevents timing-related failures, ensures environment is provisioned before app deployment, provides visibility into provisioning progress.

See full documentation for complete deployment patterns, Pulumi configuration, monitoring, and production checklist.

GitHub リポジトリ

pr-pm/prpm
パス: .claude/skills/beanstalk-deploy
claudeclaude-codecursorcursor-ai-editcursorrulespackage-manager

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る