Practicing Auto Scaling Groups (ASG) in AWS
In this session, we walk through the process of creating and managing an Auto Scaling Group (ASG) in AWS. This includes setting up a Launch Template, configuring instance scaling, and integrating with an Application Load Balancer (ALB) for automated instance management.
1. Preparing for ASG Setup
Terminate Existing EC2 Instances
Before starting, ensure that all running EC2 instances are terminated, so we begin with zero active instances.
2. Creating an Auto Scaling Group
Navigate to Auto Scaling Groups in the AWS Management Console and click Create Auto Scaling Group.
Naming and Launch Template
- Auto Scaling Group Name:
DemoASG
- Launch Template: A template must be created for defining EC2 instance configurations.
Creating a Launch Template
- Name:
MyDemoTemplate
- Amazon Machine Image (AMI):
- Select Amazon Linux 2 (x86, Free Tier Eligible)
- Instance Type:
- Choose t2.micro (Free Tier eligible).
- Key Pair:
- Select
EC2 tutorial (for SSH access).
- Storage:
- Security Group:
- Select an existing security group (e.g.,
launch-wizard-1).
- User Data Script:
- Add a user data script to install and configure a web server.