Automatic Relaunch of Terminated EC2 may launch by another instance even after we terminate an Amazon EC2 instance.
Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.
Today, let us see why this happens, and how we can stop new instances from re-launching.
Automatic Relaunch of Terminated EC2
To improve the fault tolerance of an application, some services allow the automatic launch of instances to replace terminated instances.
To prevent this, we need to delete the Auto Scaling group or terminate the Elastic Beanstalk environment.
Before we proceed, we make sure to create a backup of the EC2 instance.
Delete the Auto Scaling group
- Initially, we make note of the instance ID of the re-launched instance.
- Then we confirm the Auto Scaling group that causes the re-launch.
- After that, we open the Amazon EC2 console, ensure we’re in the correct Region.
- In the left navigation pane, we select the Auto Scaling group and open it in a new window.
- We select, Auto Scaling group > Activity History.
- Then we verify the instance ID of the re-launched instance.
- Here, we select, Actions > Delete > Yes, delete.
- Finally, we select Instances. The termination is done and a new instance doesn’t launch.
Suppose, the instance ID doesn’t match or there are no Auto Scaling groups in this Region. Then our Support Techs suggest the following section.
Terminate the Elastic Beanstalk environment
- First, we open the AWS Elastic Beanstalk console.
- Here, we select Environments and then select the name of the environment from the list.
- Verify that the name of the re-launched EC2 instance is the same as the Elastic Beanstalk environment.
- Then we select, Environment actions > Terminate Environment.
- Eventually, we confirm the environment termination.
It might take a few minutes to terminate the AWS resources.
[Need help with the fix? We’d be happy to assist]
In short, we saw how our Support Techs stop the automatic relaunch of terminated EC2.