Bobcares

Delete Auto Scaling infrastructure in EC2 – How to do it

by | Aug 29, 2021

Want to delete Auto Scaling infrastructure in EC2? We can help you.

If we delete an Auto Scaling group, it terminates the instances. It also deletes any associated logs or data, and any volumes on the instance.

Here, at Bobcares, we assist our customers with several AWS queries as part of our AWS Support Services.

Today, let us see how we can delete the auto scalling infrastructure.

 

Delete Auto Scaling infrastructure in EC2

In case we do not want to terminate one or more instances, we can detach them before we delete the Auto Scaling group.

Delete via console:

  1. Initially, we open the Amazon EC2 Auto Scaling console.
  2. There, we can see a check box next to the Auto Scaling group, we select it and then select Delete.
  3. In case of a prompt for confirmation, we select Delete.
  4. A loading icon in the Name column indicates the deletion.

It will take a few minutes to terminate the instance and delete the group. To see the current state, we can refresh the list.

Delete via AWS CLI:

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

Suppose the group has instances or scaling activities in progress, then we use:

aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-asg --force-delete

 

(Optional) Delete the launch configuration

Moving ahead, our Support Techs discusses few options to delete. We can skip them to keep the launch template for future use.

Delete via console:

  1. First, we open the Amazon EC2 console.
  2. Then under AUTO SCALING, we select Launch Configurations.
  3. On that page, we select the launch configuration > Actions > Delete launch configuration.
  4. For confirmation, we select, Yes, Delete.

Delete via AWS CLI:

aws autoscaling delete-launch-configuration --launch-configuration-name my-launch-config

 

(Optional) Delete the launch template

It is possible for us to delete the launch template or just one version of the launch template.

Delete via console:

  1. Initially, we open the Amazon EC2 console.
  2. Then under INSTANCES, we select Launch Templates.
  3. We select the launch template and then do one of the following:
  4. Actions > Delete template > Delete launch template.
  5. Actions > Delete template version > Select the version > Delete launch template version.

Delete via AWS CLI:

aws ec2 delete-launch-template --launch-template-id lt-068f72b72934aff71

Alternatively, to delete a specific version of a launch template, we run:

aws ec2 delete-launch-template-versions --launch-template-id lt-068f72b72934aff71 --versions 1

 

(Optional) Delete the load balancer and target groups

Our Support Techs does not recommend this if the Auto Scaling group does not associate with an Elastic Load Balancing load balancer.

Delete load balancer via console:

  1. Firstly, we open the Amazon EC2 console.
  2. From under LOAD BALANCING, we select Load Balancers.
  3. Then we select the load balancer > Actions > Delete.
  4. Finally, for confirmation, we select Yes, Delete.

Delete target group via console:

  1. Under LOAD BALANCING, we select Target Groups.
  2. We select the target group and select Actions > Delete.
  3. For confirmation, we select Yes.

Delete the load balancer via AWS CLI:

For Application Load Balancers and Network Load Balancers, we use:

aws elbv2 delete-load-balancer --load-balancer-arn my-load-balancer-arn aws elbv2 delete-target-group --target-group-arn my-target-group-arn

For Classic Load Balancers, we use:

aws elb delete-load-balancer --load-balancer-name my-load-balancer

 

(Optional) Delete CloudWatch alarms

Suppose the Auto Scaling group does not associate with any CloudWatch alarms. Then we skip this section.

Delete via console:

  1. Initially, we open the CloudWatch console.
  2. Then we select Alarms on the navigation pane.
  3. After that, we select the alarms and then Action > Delete.
  4. For confirmation prompt, we select Delete.

Delete via AWS CLI:

Generally, we can delete one or more alarms at a time.

aws cloudwatch delete-alarms --alarm-name Step-Scaling-AlarmHigh-AddCapacity Step-Scaling-AlarmLow-RemoveCapacity

[Need help with any of the above steps? We are available 24*7]

 

Conclusion

In short, we saw how our Support Techs delete the auto scaling infrastructure.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF