Hey there, I see that you are having issues getting the value of the disableApiStop. From what I have read you mention that the call does not fail but the value is not returned. I tested the scenario and from what I gathered from running two commands one after the other is that the first command worked and the second did not fail but the describe value was not returned, which is similar to what you got. Trying to troubleshoot the issue I found a possible reason for this is Eventual consistency, this means that the command you run (initially) that affects your EC2 resources might not be immediately visible to commands you run after running the initial command. Happens when running commands directly after each other.
With that being said your environment could have also been affected by Eventual Consistency. I have added in the references a link on Eventual Consistency and how to best manage it [1]. To add can it be possible that you did not add
aws ec2
(e.g
aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute blockDeviceMapping
) in front of the command ?
You can reach out to AWS Premium Support if you are encountering further issues and to help troubleshoot your issue in detail [2].
References :
To anyone reading this who has a similar problem, I suggest trying to stop the instance and catching the error if the instance has disableApiStop
enabled. You can then disable disableApiStop
before stopping the instance.
Relevant questions
Stop or force stop instance does not works
asked a year agoHow to disable deletion protection?
asked 4 years agoHow to get value of the disableApiStop (stop protection) instance attribute via the AWS API/CLI/boto3?
asked 2 months agoI am not able to stop or terminate the server
asked 2 months agoStart & Stop of EC2 instance using tags in Lambda function
Accepted Answerasked 5 months agoHow to stop EC2 instance?
asked 4 months agoUnable to stop an instance
asked 2 months agoHow long is the stop of EC2?
Accepted Answerasked 2 months agoHow to set the inividual data source of a pipline resolver function via CLI Amplify
asked 5 months agoHow can I retrieve the list of all databases in an RDS DB instance via API?
Accepted Answerasked 2 years ago
Hi Antonio, thank you for your comment.
Did you run both commands against the same instance? Did you specifically check for disableApiStop?
describe-instance-attribute
appears to work for all other values. I have attempted to repeatedly run the command against a large collection of instances with no luck.Whilst this is possible, I am talking about instances that have been up for months, and no changes have been made. I find this unlikely.
The full command I have been using is the following
aws ec2 describe-instance-attribute --attribute disableApiStop --instance-id i-xxxxx
. As an aside, I have also tested the API via some SDKs including Boto3.