How to run a fleet-wide operation on EC2 safely
언제 쓸까: You need to patch or restart a group of instances matching a tag, without writing the whole script yourself.
사전 조건
- Skill installed — git clone https://github.com/zxkane/aws-skills ~/.claude/skills/aws-skills
- aws CLI configured — aws configure or SSO profile
흐름
-
Dry-run the queryUse aws-skill. List EC2 instances tagged Env=staging, App=api. Just describe, don't mutate.✓ 복사됨→ Table of instance IDs with state
-
Plan the actionNow propose the command to restart all running ones. Show me the exact aws cli call before running it.✓ 복사됨→ Command printed; no execution yet
-
Execute with guardrailsExecute in batches of 3 with 30s between batches. Abort if any fails.✓ 복사됨→ Batched output with success/failure per batch
결과: A controlled fleet operation with no unpleasant surprises.
함정
- Wrong profile/region destroys prod — Always echo the resolved profile + region as the first line of any action