# Module 10

### Exam

* Target group
* Types of load balancers
  * Application Load Balancer
  * Network Load Balancer
  * Classic Load Balancer

### Elastic Load Balancing

* Put servers in target group
* Target group determines which servers are healthy via the HTTP headers being sent to / (root)
* Users can send their requests to the Elastic Load Balancers public IP
* The load balancer will distribute the traffic amongst the **HEALTHY** servers

<figure><img src="/files/BWu6QVuda0kp9gDZu44H" alt=""><figcaption></figcaption></figure>

* Distributes incoming application or network traffic across multiple targets in a single Availability Zone or across multiple Availability Zones
* Scales your load balancer as traffic to your application changes over time.

<figure><img src="/files/Lbnj6WbtvypGz2GnnYaB" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
A target group is like a container of servers that are monitored for health
{% endhint %}

* When the load balancer detects an unhealthy target, it stops routing traffic to that target. It then resumes routing traffic to that target when it detects that the target is healthy again
* With Application Load Balancers and Network Load Balancers, you register targets in target groups, and route traffic to the target groups. With Classic Load Balancers, you register instances with the load balancer

### Types of Load Balancers

<figure><img src="/files/07zZpvRrQ2bEPERCO4UF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/BKMZt5fJa767jMebyK5l" alt=""><figcaption></figcaption></figure>

* Gateway Load balancers are used for third party devices like Cisco routers or Checkpoint firewalls

### How Elastic Load Balancing Operates

* With Application Load Balancers and Network Load Balancers, you register targets in target groups and route traffic to the target groups
* With Classic Load Balancers, you register instances with the load balancer

<figure><img src="/files/ZzcymCJf7VDKVan6QsBg" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Load balancer performs health checks to monitor the health of registered targets
{% endhint %}

The Front-End will have a **public-facing load balancer** (public IP) and the Back-End will have an **internal load balancer** (private IP)

<figure><img src="/files/cDZnQKaYbsGqhnreS6zx" alt=""><figcaption></figcaption></figure>

#### Use Cases

* Highly available and fault-tolerant applications
* Containerized applications
* Elasticity and scalability
* VPC's
* Hybrid environments
* Invoke Lambda functions over HTTP(S)

{% hint style="success" %}
Amazon CloudWatch, CloudTrail and Access logs can be used to monitor the load balancer
{% endhint %}

### Auto Scaling Group

<figure><img src="/files/GSeS4VfclGCjN2UeWdji" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
An Auto Scaling group is a collection of EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management.
{% endhint %}

1. Create a Launch Template object
   1. Choose an image/AMI to use (website, template, etc.)
2. Create Auto Scaling Group (ASG)
   1. This will talk to the load balancer
   2. It will dynamically create instances based on the health nodes and other metrics (CPU)
   3. The minimum and maximum amount of instances can be made
   4. Dynamic auto scaling can be configured to trigger a new instance if the cpu (based on Cloud Watch)
      1. Simple
      2. Steps

Multiple metrics and actions can be configured

{% hint style="info" %}
There is also an option to not use Cloudwatch. It will use the target tracking policy instead
{% endhint %}

<figure><img src="/files/oH6IOcDlWKQO8TAsypzF" alt=""><figcaption></figcaption></figure>

### QUIZ ANSWERS

<figure><img src="/files/DaLtknUIZOchoYwlzjNc" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3yJH6Kg6eUZuTcWYk4Iy" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/JyVDNDHxyxd1Yw54LHqA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/C0eBi4IUWlWNM77Ov32H" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/SmvxcFOwOELBPDhoJdW8" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Cy0GLVaHKaTN6MTvLShp" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/xbc982wOaMJGPVYdzXGg" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/EIvnU5dHRMPuAqUvyJkX" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://awsfdn.adot8.com/module-10.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
