Unable to stop an instance
Unable to stop an instance that had stop protection enabled. So while trying to change the stop protection, facing the below error. "An error occurred while changing the stop protection setting of this instance." I have also enabled termination protection for this instance.
Hi.
Normally, the error does not occur because the stop is not required to change the stop protection setting.
What error do I get when I try to disable stop protection from the CLI?
aws ec2 modify-instance-attribute --instance-id i-01234567890abc --no-disable-api-stop
Hi,
From the notes, I understand that you are unable to stop an instance that had Stop Protection enabled. You will need to ensure Stop Protection (and Termination Protection, if applicable) for this instance are disabled. To rule out any browser issues, you may use the AWS CLI as a workaround, with a user or role that can perform this action. See below CLI command:
You can use the AWS CLI command below to validate the state of the instance:
$ aws ec2 describe-instances --instance-id i-1234567890abcdef0
To disable Stop Protection via the AWS CLI, use the command below:
aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --no-disable-api-stop
To disable Termination Protection via the AWS CLI, use the command below:
$ aws ec2 modify-instance-attribute --no-disable-api-termination --instance-id i-1234567890abcdef0
For the above AWS CLI command, you must use the latest version of AWS CLI Version 2, see link [1]. For disabling Stop Protection for an instance of your choosing, see link [2].
Resources:-
[1] https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
[2] https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-instance-attribute.html
Relevant questions
instance status unknown - stop process hung
asked 3 years agoInstance won't stop
asked 3 years agoInstances unreachable and unable to stop/restart
asked 2 years agoNeed EC2 Technical Support to Please Stop Instance ASAP
asked a year agoStuck instance will not stop
asked 6 months agoNeed EC2 Technical Support to Please Stop Instance ASAP
asked a year agoStop or force stop instance does not works
asked a year agoHow long is the stop of EC2?
Accepted Answerasked 12 days agoUnable to stop an instance
asked 22 days agoI am not able to stop or terminate the server
asked 7 days ago