59 cards
Posted over 1 year ago. Visible to the public.

HowTo: enable termination protection for all EC2 instances not in autoscaling groups via aws cli

Copy
aws ec2 describe-instances --output text --query 'Reservations[].Instances[?!not_null(Tags[?Key == `aws:autoscaling:groupName`].Value)] | [].[InstanceId]' | xargs -L1 -t aws ec2 modify-instance-attribute --disable-api-termination --instance-id

Owner of this card:

Avatar
Claus-Theodor Riegg
Last edit:
over 1 year ago
by Claus-Theodor Riegg
Keywords:
disable-api-termination, api, termination
This website uses short-lived cookies to improve usability.
Accept or learn more