Skip to content

Instantly share code, notes, and snippets.

@cocoy
Created February 22, 2011 07:07
Show Gist options
  • Save cocoy/838322 to your computer and use it in GitHub Desktop.
Save cocoy/838322 to your computer and use it in GitHub Desktop.
Check and protect instance for termination:
Check if termination is allowed:
for i in `ec2-describe-instances | grep ^INSTANCE | cut -f2`; do ec2dinatt --disable-api-termination $i ; done
Protect:
for i in `ec2-describe-instances | grep ^INSTANCE | cut -f2`; do ec2minatt --disable-api-termination true $i ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment