100 Days of DevOps — Day 20— Auto-Scaling Group using Terraform

Welcome to Day 20 of 100 Days of DevOps, Let continue our terraform journey, yesterday we created an application load balancer, let expand that concept and put this load balancer as a part of the auto-scaling group.

What is Auto Scaling?

What auto-scaling will do, it ensures that we have a correct number of EC2 instances to handle the load of your applications.

How Auto Scaling works

Reference: https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html

In the above example, Auto Scaling has

Step1: The first step in creating the AutoScaling Group is to create a launch configuration, which specifies how to configure each EC2 instance in the autoscaling group.


output "target_group_arn" {
value = "${aws_lb_target_group.my-alb-tg.arn}"

and then run terraform apply command, you will see something like this

Outputs:target_group_arn = arn:aws:elasticloadbalancing:us-west-2:XXXXXX0:targetgroup/my-alb-tg/85a23209f9c37964

GitHub Link for the complete ASG code

Looking forward from you guys to join this journey and spend a minimum an hour every day for the next 100 days on DevOps work and post your progress using any of the below medium.


AWS Community Builder, Ex-Redhat, Author, Blogger, YouTuber, RHCA, RHCDS, RHCE, Docker Certified,4XAWS, CCNA, MCP, Certified Jenkins, Terraform Certified, 1XGCP