ASG and ELB Flashcards

1
Q

What is the advantage of using launch template instead of launch configuration in ASG?

A

You can only use a launch template to provision capacity across multiple instance types using both On-Demand Instances and Spot Instances to achieve the desired scale, performance, and cost

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

Default Termination Policy

A
  1. Pick AZ with most instances and one or more instances not protected from scale in
  2. Determine if instance is outside of allocation strategy for on-demand or spot (e.g. instance type re-prioritization)
  3. Determine if any of the instances have oldest launch template or configuration - termination policy prefers configs over templates
  4. Determine which instance is the closest to the next billing hour
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Amazon EC2 Auto Scaling lifecycle hooks

Popular use cases

A

enable an Auto Scaling group to be aware of events in the Auto Scaling instance lifecycle, and then perform a custom action when the corresponding lifecycle event occurs. A lifecycle hook provides a specified amount of time (one hour by default) to complete the lifecycle action before the instance transitions to the next state.
Popular uses of lifecycle hooks
- control when instances are registered with Elastic Load Balancing
-Install or configure software on newly launched images
-Download log files form instance before it terminates

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

Scheduled scaling

A

Scheduled scaling helps you to set up your own scaling schedule according to predictable load changes.

To use scheduled scaling, you create scheduled actions. Scheduled actions are performed automatically as a function of date and time.

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

Predictive scaling is well suited for what situations

A

Cyclical traffic, such as high use of resources during regular business hours and low use of resources during evenings and weekends

Recurring on-and-off workload patterns, such as batch processing, testing, or periodic data analysis

Applications that take a long time to initialize, causing a noticeable latency impact on application performance during scale-out events

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

Predictive scaling is well suited for what situations

A

Cyclical traffic, such as high use of resources during regular business hours and low use of resources during evenings and weekends

Recurring on-and-off workload patterns, such as batch processing, testing, or periodic data analysis

Applications that take a long time to initialize, causing a noticeable latency impact on application performance during scale-out events

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

predictive scaling

A

Use predictive scaling to increase the number of EC2 instances in your Auto Scaling group in advance of daily and weekly patterns in traffic flows.

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

scaling cooldown

A

helps you prevent your Auto Scaling group from launching or terminating additional instances before the effects of previous activities are visible.

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

What are Step adjustments? What is specified in a Step adjustment?

A

They increase or decrease the current capacity of your Auto Scaling group, based on the size of the alarm breach.

Specify the following:
A lower bound for the metric value

An upper bound for the metric value

The amount by which to scale, based on the scaling adjustment type

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

What do step and simple scaling policies have in common?

A
  1. require you to create CloudWatch alarms
  2. require you to specify the high and low thresholds for the alarms.
  3. define whether to add or remove instances, and how many, or set the group to an exact size
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the main difference in step and simple scaling policies?

A

The main difference between the policy types is the step adjustments that you get with step scaling policies. When step adjustments are applied, and they increase or decrease the current capacity of your Auto Scaling group, the adjustments vary based on the size of the alarm breach.

In most cases, step scaling policies are a better choice than simple scaling policies, even if you have only a single scaling adjustment.

step scaling the policy can continue to respond to additional alarms, even while a scaling activity or health check replacement is in progress

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

What are the types of AWS dynamic scaling policies?

A

Target tracking scaling—Increase or decrease the current capacity of the group based on a target value for a specific metric. This is similar to the way that your thermostat maintains the temperature of your home—you select a temperature and the thermostat does the rest. e.g. # of messages in SQS queue

Step scaling—Increase or decrease the current capacity of the group based on a set of scaling adjustments, known as step adjustments, that vary based on the size of the alarm breach. e.g. 90% CPU over specific time frame.

Simple scaling—Increase or decrease the current capacity of the group based on a single scaling adjustment.

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

What are the types of AWS dynamic scaling policies?

A

Target tracking scaling—Increase or decrease the current capacity of the group based on a target value for a specific metric. This is similar to the way that your thermostat maintains the temperature of your home—you select a temperature and the thermostat does the rest. e.g. # of messages in SQS queue

Step scaling—Increase or decrease the current capacity of the group based on a set of scaling adjustments, known as step adjustments, that vary based on the size of the alarm breach. e.g. 90% CPU over specific time frame.

Simple scaling—Increase or decrease the current capacity of the group based on a single scaling adjustment.

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

What is dynamic scaling policy?

A

A dynamic scaling policy instructs Amazon EC2 Auto Scaling to track a specific CloudWatch metric, and it defines what action to take when the associated CloudWatch alarm is in ALARM.

Metrics are averaged across the ASG. e.g. two instances, one CPU=40% and the other CPU=60%, avg CPU = 50% will be considered to determine CPU for the group.

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

List and Describe ALB Content Routing Methods

A

Host-based Routing : You can route a client request based on the Host field of the HTTP header allowing you to route to multiple domains from the same load balancer.

Path-based Routing : You can route a client request based on the URL path of the HTTP header.

HTTP header-based routing : You can route a client request based on the value of any standard or custom HTTP header.

HTTP method-based routing : You can route a client request based on any standard or custom HTTP method.

Query string parameter-based routing : You can route a client request based on query string or query parameters.

Source IP address CIDR-based routing : You can route a client request based on source IP address CIDR from where the request originates.

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

ALB Targets & Description

A

IP addresses as Targets
You can load balance any application hosted in AWS or on-premises using IP addresses of the application backends as targets.

Lambda functions as Targets
Application Load Balancers support invoking Lambda functions to serve HTTP(S) requests enabling users to access serverless applications from any HTTP client, including web browsers.

EC2 Instances

Containers -provides enhanced container support by load balancing across multiple ports on a single Amazon EC2 instance. Deep integration with the Amazon Elastic Container Service (ECS), provides a fully-managed container offering.

15
Q

ALB HTTPS Support

A

An Application Load Balancer supports HTTPS termination between the clients and the load balancer. Application Load Balancers also offer management of SSL certificates through AWS Identity and Access Management (IAM) and AWS Certificate Manager for pre-defined security policies.

16
Q

Scope of ASG

A

AZ

17
Q

ASG Standby State

A

You can put an instance that is in the InService state into the Standby state, update some software or troubleshoot the instance, and then return the instance to service. Instances that are on standby are still part of the Auto Scaling group, but they do not actively handle application traffic.

18
Q

ReplaceUnhealthy

A

terminates instances that are marked as unhealthy and then creates new instances to replace them.

19
Q

Check if time…What happens when ReplaceUnhealthy is suspended? unsuspended?

A

Amazon EC2 Auto Scaling stops replacing instances that are marked as unhealthy. Instances that fail EC2 or Elastic Load Balancing health checks are still marked as unhealthy. As soon as you resume the ReplaceUnhealthly process, Amazon EC2 Auto Scaling replaces instances that were marked unhealthy while this process was suspended.

20
Q

Scope of ELB service

A

ELB is a regional service

21
Q

ALB Targets

A

IP addresses
Lambda functions
EC2 Instances
Containers?

22
Q

Describe the ALB IP Address Target

What restrictions apply to the ALB itself with respect to IP?

A

You can load balance any application hosted in AWS or on-premises using IP addresses of the application backends as targets

Only private IPs can be used

ALB can’t be assigned an Elastic IP (static IP)

23
Q

Describe ALB Lambda Target

A

Application Load Balancers support invoking Lambda functions to serve HTTP(S) requests enabling users to access serverless applications from any HTTP client, including web browsers.

24
Q

Describe EC2 target type for ALB

A

Specify instance ID to target EC2

25
Q

Describe ALB container target

A

provides enhanced container support by load balancing across multiple ports on a single Amazon EC2 instance. Deep integration with the Amazon Elastic Container Service (ECS), provides a fully-managed container offering.

26
Q

Permissions boundary

A

control the maximum permissions granted to IAM principals (users and roles) that they create and manage

27
Q

How does ASG Launch Config Tenancy vs VPC tenancy configured impact the EC2 that is launched? What will the tenancy be based on Launch Config and VPC tenancy settings?

Draw matrix to help with answer if you want

A

If either the VPC or Launch config sets dedicated as tenancy value, the EC2 will have dedicated tenancy

If the Launch config doesn’t specify, the EC2 will have tenancy of VPC

By default VPC tenancy is default - i.e. shared tenancy

28
Q

ELB Listener

A

You configure your load balancer to accept incoming traffic by specifying one or more listeners

configured with a protocol and port number for connections from clients and a protocol and port number to establish connections to targets

29
Q

Cross-zone load balancing - enabled vs disabled

A

When cross-zone load balancing is enabled, each load balancer node distributes traffic across the registered targets in all enabled Availability Zones. When cross-zone load balancing is disabled, each load balancer node distributes traffic only across the registered targets in its Availability Zone.

30
Q

ELB Node

A

When you enable an Availability Zone for your load balancer, Elastic Load Balancing creates a load balancer node in the Availability Zone

31
Q

What happens when targets in an AZ are registered with ELB but AZ isn’t enabled?

A

registered targets do not receive traffic

32
Q

Connection Draining

A

To ensure that a Classic Load Balancer stops sending requests to instances that are de-registering or unhealthy, while keeping the existing connections open, use connection draining. This enables the load balancer to complete in-flight requests made to instances that are de-registering or unhealthy

33
Q

idle connection timeout

A

For Classic Load Balancers

If no data has been sent or received by the time that the idle timeout period elapses, the load balancer closes the connection

To ensure that lengthy operations such as file uploads have time to complete, send at least 1 byte of data before each idle timeout period elapses, and increase the length of the idle timeout period as needed

34
Q

What happens when there are multiple scaling policies in force at the same time for an ASG?

A

Amazon EC2 Auto Scaling chooses the policy that provides the largest capacity for both scale out and scale in