- Newest
- Most votes
- Most comments
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 content
- asked 2 years ago
- asked 8 months ago
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year 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.