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