Amazon EC2 - Auto Scaling Groups - Application Load Balancer
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-01-15 11:14:20

[15/100] #100DaysOfCloud Today, I created an Auto Scaling Group (ASG) and placed it behind an Application Load Balancer (ALB) and deployed Instances with a Target Group. The Instance will be stressed to cause spike in CPU utilization above the threshold which will cause the Health checks to fails and replace and auto-scale accordingly with healthy ones.

- Elastic Load Balancing (ELB) : automatically distributes incoming application traffic across multiple targets and virtual appliances in one or more Availability Zones (AZs).
 - Application load balancing : routes traffic for HTTP-based requests.
 - Network load balancing : routes traffic based on IP addresses. It is ideal for balancing TCP and User Datagram Protocol (UDP)-based requests.
 - Gateway Load Balancer : routes traffic to third-party virtual appliances. It is ideal for incorporating a third-party appliance, such as a network firewall, into your network traffic in a scalable and easy-to-manage way.
 - Classic Load Balancer : routes traffic to applications in the Amazon EC2-Classic network—a single, flat network that you share with other customers. 

- Auto Scaling Groups (ASG) : AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost. Using AWS Auto Scaling, it’s easy to setup application scaling for multiple resources across multiple services in minutes. The service provides a simple, powerful user interface that lets you build scaling plans for resources including Amazon EC2 instances and Spot Fleets, Amazon ECS tasks, Amazon DynamoDB tables and indexes, and Amazon Aurora Replicas. AWS Auto Scaling makes scaling simple with recommendations that allow you to optimize performance, costs, or balance between them.

- Target Groups : A target group tells a load balancer where to direct traffic to : EC2 instances, fixed IP addresses; or AWS Lambda functions, amongst others. When creating a load balancer, you create one or more listeners and configure listener rules to direct the traffic to one target group. Each target group is used to route requests to one or more registered targets. When you create each listener rule, you specify a target group and conditions. When a rule condition is met, traffic is forwarded to the corresponding target group. You can create different target groups for different types of requests. You define health check settings for your load balancer on a per target group basis. Each target group uses the default health check settings, unless you override them when you create the target group or modify them later on. After you specify a target group in a rule for a listener, the load balancer continually monitors the health of all targets registered with the target group that are in an Availability Zone enabled for the load balancer. The load balancer routes requests to the registered targets that are healthy.

- Launch Template : enables a new way to templatize your launch requests. Launch Templates streamline and simplify the launch process for Auto Scaling, Spot Fleet, Spot, and On-Demand instances. Launch Templates reduce the number of steps required to create an instance by capturing all launch parameters within one resource. This makes the process easy to reproduce. Also, through support for Auto Scaling, Spot Fleet, Spot and On-Demand instances, Launch Templates make it easier to implement standards and best practices, helping you to better manage costs, improve your security posture, and minimize the risk of deployment errors.

You can try to create an Auto Scaling Group (ASG) and placed it behind an Application Load Balancer (ALB) and deployed Instances with a Target Group by yourself by following the steps from the link below :
[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/015/Readme.md)