Why can't I terminate my Amazon EC2 instance?
Last updated: 2020-06-03
Why can't I terminate my Amazon Elastic Compute Cloud (Amazon EC2) instance?
Your EC2 instance might not terminate for the following reasons:
- The instance is in the stopping or pending state.
- Termination protection is enabled on the instance.
- There are incorrect permissions on the AWS Identity and Access Management (IAM) policy attached to the role or user attempting to terminate the instance.
The instance is in the stopping or pending state
If the instance appears to be "stuck" in the stopping state, see Troubleshooting stopping your instance. After you have successfully stopped the instance, you can terminate it.
If the instance remains in the pending state for more than 30 minutes after you attempt to launch it, then run the stop or terminate command from the AWS Command Line Interface (AWS CLI). To assist with troubleshooting, enable the --debug option.
Termination protection is enabled on the instance
If termination protection is enabled, you can't terminate the instance. For information on disabling termination protection on your instance, see Enabling termination protection and follow the instructions in To disable termination protection for a running or stopped instance.
The IAM policy attached to the role or user attempting to terminate the instance must allow the ec2:TerminateInstances API. For information on editing IAM policies, see Editing IAM Policies.