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