Create Auto Scaling Group

Create Auto Scaling group

  1. Search EC2 , scroll down to Auto Scaling group to create a new one

  2. Section Name , enter MyASG

  3. In Launch Template, select MyLT1 and click Next ASG

  4. In Network section, select VPC as ASG-ALB-vpc and select 2 public subnets and click next ASG

  5. Select Attach to an existing load balancer

  6. In the Attach to an existing load balancer section below, select Choose from your load balancer target group

  7. Select TG1 ASG

  8. Leave the rest as default and select Next

  9. In the Group size section, set Desired capacity to 2

  10. In the Scaling section:

  • Min desired capacity : 2
  • Max desired capacity : 4 ASG
  1. In the Automatic scaling section, select Target tracking scaling policy ASG

  2. Leave the rest as default and select Next

    Here we will use the SNS service to send notifications via email

  3. We choose Add notification

  • We name the topic my-topic
  • In the with these recipients section, we type the email address
  • Event types , we select all
  • Click Next SNS
  1. Immediately after that you can see an email from AWS sent to confirm, click on the link Confirm subscription SNS SNS

  2. Leave the rest as default and then create the file. We will have to wait a few minutes for the Auto Scaling group to create EC2s and check their status.

Check the status of Load balancers

  1. Search EC2 -> Find Load Balancer and select ALB-1

  2. Find the Resource map - new section below, we can see that the Instances created by the Auto Scaling group all have the status Healthy LB

  3. Switch to the Details tab next to it, scroll down and click copy DNS name and paste it into the browser, we will get: LB