How to run a fleet-wide operation on EC2 safely
Quando usar: You need to patch or restart a group of instances matching a tag, without writing the whole script yourself.
Pré-requisitos
- Skill installed — git clone https://github.com/zxkane/aws-skills ~/.claude/skills/aws-skills
- aws CLI configured — aws configure or SSO profile
Fluxo
-
Dry-run the queryUse aws-skill. List EC2 instances tagged Env=staging, App=api. Just describe, don't mutate.✓ Copiado→ 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.✓ Copiado→ Command printed; no execution yet
-
Execute with guardrailsExecute in batches of 3 with 30s between batches. Abort if any fails.✓ Copiado→ Batched output with success/failure per batch
Resultado: A controlled fleet operation with no unpleasant surprises.
Armadilhas
- Wrong profile/region destroys prod — Always echo the resolved profile + region as the first line of any action