EC2 instances and networking
high risk
aws ec2 <action> --dry-runValidate permissions without actingaws ec2 create-snapshot --volume-id <vol>Snapshot before destructive changesManage instances, volumes, security groups and AMIs.
| Flag | Meaning |
|---|---|
describe-instances | List instances |
stop-instances | Stop |
terminate-instances | Delete⚠ Irreversible; root EBS volumes are deleted by default. |
authorize-security-group-ingress | Open a port⚠ 0.0.0.0/0 exposes the service to the Internet. |
--dry-run --dry-run | Check permissions without acting |
aws ec2 describe-instances --filters Name=tag:Env,Values=prodProd instances · explain & risk-check →aws ec2 stop-instances --instance-ids i-123 --dry-runDry run · explain & risk-check →Reference text is hand-written and may be incomplete — check man aws for your version. Test destructive commands on a non-production system first.