- Newest
- Most votes
- Most comments
When an EC2 instance is stuck in the "shutting-down" state for an extended period (like 9 days in your case), it indicates an issue with the termination process. Since this instance is managed by Amazon EKS and you're facing authorization issues due to Kubernetes policies, you'll need to take a different approach.
For instances stuck in the "shutting-down" state that are part of an EKS cluster, here's what you can try:
-
First, try to remove the machine's finalizer if it's an EKS Anywhere cluster node. This might help release the node from its stuck state.
-
Try using the AWS CLI to force terminate the instance:
aws ec2 terminate-instances --instance-ids i-030cfce4f5d6008a1
- If that doesn't work, try force stopping the instance first:
aws ec2 stop-instances --instance-ids i-030cfce4f5d6008a1 --force
- If you're still unable to terminate the instance due to permission issues, you may need to:
- Contact your AWS administrator who has the necessary permissions to override the Kubernetes policies
- If you have AWS Support, create a technical support case explaining that the instance has been stuck in "shutting-down" state for 9 days
The good news is that you're not being charged for EC2 compute usage while the instance is in the "shutting-down" state. However, you may still be charged for any attached EBS volumes.
For the pending pods, they're likely in that state because they're assigned to a node that's no longer functional. Once you resolve the instance termination issue, you should be able to reschedule those pods on healthy nodes.
Sources
Instance stuck in "shutting down" state | AWS re:Post
Troubleshoot nodes for Amazon EKS Anywhere clusters | AWS re:Post
Troubleshoot Amazon EC2 instance termination issues - Amazon Elastic Compute Cloud
Troubleshoot Amazon EC2 instance stop issues - Amazon Elastic Compute Cloud
Understand why GPU and metal EC2 instances take a long time to stop | AWS re:Post
answered 9 months ago
Hey,
Hope you're keeping well.
In EKS managed node groups, EC2 instances are owned by the underlying Auto Scaling group, so direct termination from the EC2 console is usually blocked. A stuck instance in shutting-down state often means the ASG is trying to drain and replace it but is blocked by IAM or Kubernetes finalizers. Check the node group in the EKS console and try scaling it down to force the ASG to remove the instance. If that fails, go to the Auto Scaling group in the EC2 console, detach the instance, then terminate it from EC2 (requires appropriate IAM permissions). You may also need to remove any Kubernetes finalizers from the Node object with kubectl edit node <name> so the deletion can complete.
Thanks and regards,
Taz
answered 9 months ago
Thank you Taz, The only thing that worked is: "You may also need to remove any Kubernetes finalizers from the Node object with kubectl edit node <name> so the deletion can complete.". But.. the instance is now out of the K8 cluster list, but it's state in EC2 console is still shutting-down state :( and I cannot terminate this instance because I do not have "ec2:StopInstances" permission on this resource with an explicit deny in a resource-based policy (although I am account owner/admin). I think this is because of default EKS permissions, which i am not able to find
Relevant content
asked 4 years ago
asked 2 years ago
- AWS OFFICIALUpdated 3 years ago

Tried this. I am the Administrator of my account. The permission issue is because of the EKS protection, which I don't want to change as EKS manages the nodes in this cluster