How to delete AWS EC2 instance? It keep coming back again

Viewed 303

After terminating instance EC2 it's creating back new instance automatically. I'm using free AWS trial version and it is exceeding monthly limit.

2 Answers

This mimics the behaviour of an instance in an autoscaling group. Delete any autoscaling groups you have to ensure that no replacement instances will be created.

You can check this within the AWS console by doing the following:

  • Go to the EC2 Service
  • Click the Autoscaling Groups menu item
  • Select the autoscaling group.
  • Click the Delete button at the top of the console.

Below is where you would find the option in the menu (it's the last item), you can see the item at the bottom.

Autoscaling Groups

When you delete the autoscaling group, any instances attached to the autoscaling group will be terminated.

In case you're interested here is the documentation for autoscaling groups, to help you understand more about them.

By the way if you contact AWS support and explain, they may be able to refund assuming you never used the resource.

It seems that your instance is in AutoScaling Group.

When instances are in ASG, once terminated, ASG launches replacements.

To rectify this, you have to delete the AutoScaling group as explained in the docs:

You can use AWS CLI to delete your ASG or Concole.

For CLI:

aws autoscaling delete-auto-scaling-group --auto-scaling-group-name <my-asg>

For console

enter image description here

Related