- Newest
- Most votes
- Most comments
Even as a root user, you might encounter permission issues when trying to stop or delete EC2 instances. There are several possible causes and solutions for this issue:
-
Termination Protection: Your EC2 instances might have termination protection enabled. This is a safety feature that prevents accidental termination. You'll need to disable termination protection before you can delete these instances.
-
IAM Permissions Issue: Even though you're using the root account, there might be an IAM policy or Service Control Policy (SCP) restricting your actions, especially if your account is part of an AWS Organization.
-
Force Stop Option: For instances stuck in the 'stopping' state:
- In the EC2 console, select the instance
- Choose "Instance state" and then "Force stop instance"
- Note that this option is only available if your instance is in the 'stopping' state
- Missing IAM Permissions: You might need to ensure you have the proper permissions. For instance, when deleting instances, you need the
ec2:TerminateInstancespermission in your IAM policy.
If the instances are truly stuck and cannot be terminated through normal means, you can try:
- Force stopping the instance first, then attempt to terminate it
- If the "Force stop" option isn't available in the console, you can use the AWS CLI to force stop your instance
- If the instance still cannot be terminated, you may need to create a technical support case with AWS Support
If you're receiving a specific error message like "UnauthorizedOperation," you'll need to add the appropriate permissions to your IAM policy.
Sources
Delete an EC2 Fleet request and the instances in the fleet - Amazon Elastic Compute Cloud
Troubleshoot Amazon EC2 instance stop issues - Amazon Elastic Compute Cloud
How do I troubleshoot when User: arn is no authorized to perform Create * or Delete * or Update * on resource(s) because no identity- policy allows the actions | AWS re:Post
Error Virtual Cloud | AWS re:Post
