ELB & ASG Flashcards

1
Q

What are the four types of load balancers?

A

Classic Load Balancer, Application Load Balancer, Network Load Balancer, Gateway Load Balancer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What layer is an application load balancer?

A

Layer 7 (HTTP)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the various manners we can route to different target groups with our ALB?

A

Path-based routing, hostname-based routing, Query string/header routing, and source IP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What can be included in ALB Target groups?

A

EC2 instances, ECS tasks, Lambda functions and private IPs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you find the IP of the client for the ALB?

A

In the header X-Forwarded-For

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Network Load Balancer used for?

A

It functions at the fourth layer of the OSI model. To forward TCP & UDP traffic to your instances

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many Static IPs per AZ can a Network Load Balancer have?

A

One

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can the Target Groups of NLB be?

A

EC2 Instances, Private IPs or an ALB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: The NLB cannot have a fixed IP Address

A

False. The NLB must have a fixed IP address for each AZ.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

True or False: You must configure the security group for an NLB upon creation.

A

False. NLBs do not have security groups like ALB. The security group pertaining to the instances must be configured to allow traffic from the NLB and/or clients

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

We want to use the GENEVE protocol on port 6081 to communicate with AWS resources. What do we use?

A

A Gateway Load Balancer. A Gateway Load Balancer operates at the third layer of the Open Systems Interconnection (OSI) model. It listens for all IP packets across all ports and forwards traffic to the target group that’s specified in the listener rule, using the GENEVE protocol on port 6081.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which load balancers can Sticky Sessions be applied for?

A

ALB and CLB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do Sticky Sessions work?

A

A cookie is supplied to the client with an expiration date. The cookie determines what resource the client is directed towards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two cookies provided for Sticky Sessions?

A

Application-based cookie: Gives more control around the duration of the session

Duration-based cookie: When the client routes to a target, it is given a load balancer generated cookie that is used to map the session to a target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why would you use Cross Zone Load Balancing?

A

You want to make sure that traffic is distributed evenly for all instances ACROSS AZs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or false: Cross-Zone load balancing is always on for ALB and NLB

A

False. ALB is enabled and can’t be disabled. NLB is disabled by default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How can you configure the ALB to serve traffic to a specific target group?

A

Define the rules in the listeners. A listener is a process that checks for connection requests using a protocol and a port

18
Q

How can you configure the ALB to serve traffic to a specific target group?

A

Define a listener rule. The conditions in the listener rule help determine how the load balancer routes requests to its registered targets

19
Q

True or False: You cannot configure a security group on an ALB

A

False. An NLB does not have a security group configuration. An ALBs security group and EC2 security group must be configured

20
Q

Why would we use a Server Name Indication?

A

SNI solves the problem of loading multiple SSL certificates onto one web server.

21
Q

What is an SSL certificate?

A

It is a digital certificate that authenticates a websites identity and enables an encrypted connection

https://www.kaspersky.com/resource-center/definitions/what-is-a-ssl-certificate

22
Q

Why would we use Server Name Indication?

A

It allows the client to indicate which hostname it is trying to connect to at the start of the TLS handshake. That way, mulitple certificates can be used on one server.

23
Q

We have two domain names on a server being targeted by an ALB. How do we properly send traffic to the proper target group?

A

We can use Server Name Indication

24
Q

What is connection draining/de-registration delay?

A

ELB stops sending requests to targets that are deregistering. ELB will wait a certain amount of time (delay) to deregister so that requests in process can complete

25
Q

We need to make sure we have a certain number of EC2 instances running at any given time. What can we use?

A

An Auto Scaling Group

26
Q

We want to trigger more instances when a CloudWatch alarm is triggered, what ASG policy do we use?

A

Simple/Step Scaling

27
Q

What is the Simple/Step Scaling ASG Policy?

A

It is configured by setting a CloudWatch alarm that when triggered, adds instances

28
Q

What is the Target Tracking Scaling ASG policy?

A

It auto-scales based on average metrics, looking to keep things like CPU utilization or throughput on a specified average

29
Q

There are predictable times when the traffic on our EC2 instances will spike. What ASG policy can we use?

A

Scheduled Actions

30
Q

What is AWS Predictive Scaling for ASG?

A

It analyzes past trends, uses machine learning to generate a forecast and schedules scaling actions

31
Q

Scaling an EC2 instance from r4.large to r4.4xlarge is called….

A

Vertical Scaling. Vertical scaling is adding more compute power to existing machines

32
Q

True or False: an ALB provides a static IP

A

False. It will provide a static DNS though. AWS wants to provide a static endpoint for the ELB, even if the underlying infrastructure changes

33
Q

You are using an Application Load Balancer to distribute traffic to your website hosted on EC2 instances. It turns out that your website only sees traffic coming from private IPv4 addresses which are in fact your Application Load Balancer’s IP addresses. What should you do to get the IP address of clients connected to your website?

A

Modify your websites backend to get the client IP address from the X-Forwarded-For header

34
Q

What IP address will your instances receive when they receive requests from an ALB?

A

They will receive the ALB’s IP address. Not the clients.

35
Q

You are working as a Solutions Architect for a company and you are required to design an architecture for a high-performance, low-latency application that will receive millions of requests per second. Which type of Elastic Load Balancer should you choose?

A

Network Load Balancer

36
Q

Which protocol does ALB’s not support: HTTP, HTTPS, TCP or WebSocket?

A

TCP

37
Q

True or False: to get a static IP on an ALB, you must assign an Elastic IP

A

False. ALB cannot have static IPs. If you need a static IP, you should assign a Network Load Balancer in front.

38
Q

Which feature in both Application Load Balancers and Network Load Balancers allows you to load multiple SSL certificates on one listener?

A

Server Name Indication

39
Q

A web application is hosted on a fleet of EC2 instances managed by an Auto Scaling Group. You are exposing this application through an Application Load Balancer. Both the EC2 instances and the ALB are deployed on a VPC with the following CIDR 192.168.0.0/18. How do you configure the EC2 instances’ security group to ensure only the ALB can access them on port 80?

A

Add an Inbound Rule with port 80 and ALBs Security Group as the source. Using an ALBs security group is the best practice to keep the EC2 instances secure.

40
Q

An application is deployed with an Application Load Balancer and an Auto Scaling Group. Currently, you manually scale the ASG and you would like to define a Scaling Policy that will ensure the average number of connections to your EC2 instances is around 1000. Which Scaling Policy should you use?

A

Target Tracking Policy

41
Q

You have an ASG and a Network Load Balancer. The application on your ASG supports the HTTP protocol and is integrated with the Load Balancer health checks. You are currently using the TCP health checks. You would like to migrate to using HTTP health checks, what do you do?

A

Migrate the health checks to HTTP. A Network Load Balancer supports HTTP/s and TCP health checks.

42
Q

What is the difference between simple and step scaling policy for ASG?

A

Step will scale the number of instances based on INCREMENTAL CloudWatch triggers. Simple will scale to a specific number based on a single metric. Simple also has a cooldown period that must take place before it can scale again.