I want to get a list of instances on ec2 without termination protection.
Before I code something to do this, is there something hidden in the aws cli for this ?
Get a list of instances on ec2 without termination protection
amazon-web-servicesaws-cli
Related Topic
- How to find which Amazon AWS EC2 instances are not covered by a Reserved Instance reservation
- Command to list AWS instances that results in short output
- Get Ids of terminated EC2 instances
- How to automatically update EC2 Linux instances without downtime by switching between two instances
- AWS CLI – Fix EC2 Run-Instances Tag Specifications Parsing Error
Best Answer
It looks to me from the docs and my testing that you are looking for:
This returns
<instanceid> DISABLEAPITERMINATION True
If termination protection is on. The documentation states, "If the value is true, you can't terminate the instance through the Amazon EC2 console, CLI, or API; otherwise, you can."
And you can modify the parameter with modify-instance-attribute. So...
or