ASG Flashcards

This deck aims to help retain concepts related to the ASG service.

1
Q

What configuration template does an Auto Scaling Group use to launch EC2 instances?

A

Launch Configuration, defines parameters such as the AMI, instance type, storage, key pair, networking, security groups, user data, and instance IAM role, it is not editable and does not support versioning

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

Which configuration template offers more features than a Launch Configuration?

A

A Launch Template provides similar functionality to a Launch Configuration but with additional features such as placement groups, capacity reservations, and elastic graphics, it can be used with both Auto Scaling Groups and individual EC2 instances and supports versioning

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

What are the primary features of an ASG?

A
  • Provides automatic scaling and self-healing for EC2 instances
  • Utilizes Launch Templates or Launch Configurations
  • Configurable with min, max, and desired, capacity sizes
  • Maintains the desired number of running instances by provisioning or terminating them as needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What AWS service manages a collection of EC2 instances as a logical group for automatic scaling and management, and also provides features like health check replacements and scaling policies?

A

Auto Scaling Group (ASG)

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

What types of scaling policies does an ASG support?

A
  • Manual Scaling
  • Scheduled Scaling
  • Dynamic Scaling (Simple Scaling, Step Scaling, Target Tracking Scaling)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What architectural components automate the scaling process in an ASG by adjusting the desired capacity based on specific metrics like CPU utilization?

A

Scaling Policies (not required), an ASG can be configured with static values for minimum, maximum, and desired capacity without scaling policies

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

Which ASG Scaling Policy allows for manual adjustments to the desired capacity?

A

Manual Scaling, which is useful for testing or urgent adjustments

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

Which ASG Scaling Policy adjusts the desired capacity based on a predefined schedule?

A

Scheduled Scaling

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

Which ASG Dynamic Scaling Policy adjusts capacity based on a single scaling adjustment, with a cooldown period between actions?

A

Simple Scaling - adds or removes a static number of instances based on alarm states

For example:
If ASGAverageCPUUtilization > 50%, add 2 instances
If ASGAverageCPUUtilization < 50%, remove 2 instances

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

Which ASG Dynamic Scaling Policy adjusts capacity based on a series of scaling adjustments known as step adjustments, varying with the size of the alarm breach?

A

Step Scaling - allows for detailed rules and quicker responses to more extreme changes, defines upper and lower bounds and reacts more flexibly to changing load patterns

For example:
If ASGAverageCPUUtilization > 50%:
- 50%-59%: Do nothing
- 60%-69%: Add 1 instance
- 70%-79%: Add 2 instances
If ASGAverageCPUUtilization < 50%:
- 40%-49%: Do nothing
- 30%-39%: Remove 1 instance
- 20%-29%: Remove 2 instances

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

Which ASG Dynamic Scaling Policy adjusts capacity based on a CloudWatch metric and a target value?

A

Target Tracking Scaling
Sets an ideal metric (e.g., CPU utilization = 60%), ASG automatically adjusts the capacity to maintain the metric at the target value

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

In ASG Scaling Policies, which attribute (value in seconds) determines the waiting period between consecutive scaling actions?

A

Cooldown Period

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

Can ASG Scaling Policies be based on the number of visible messages in an SQS queue?

A

Yes, using the ApproximateNumberOfMessagesVisible metric, is a common approach in architectures for worker pools

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

How does ASG perform health checks on EC2 instances?

A

By default, ASG uses status checks to monitor EC2 instances, if an instance fails a status check, ASG terminates the instance and provisions a new one, providing self-healing capabilities

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

How can application awareness be provided to an ASG?

A

By integrating the ASG with an ELB and configuring ALB health checks instead of default EC2 status checks

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

How does the billing model for ASG work?

A

There is no cost for using ASG itself, only for the provisioned resources

15
Q

Which ASG scaling policy attribute should be used to prevent rapid scaling?

A

The Cooldown Period

16
Q

What EC2 instance sizes are best for granular scaling with ASG?

A

Smaller instance sizes

17
Q

Which services are commonly used together to provide elasticity and infrastructure abstraction?

A

ASG and ELB

18
Q

What do ASG and a Launch Template define?

A

ASG defines WHEN and WHERE, while the Launch Template defines WHAT

19
Q

What processes are available in EC2 Auto Scaling?

A

Launch, Terminate, AddToLoadBalancer, AlarmNotification, AZRebalance, HealthChecks, InstanceRefresh, ReplaceUnhealthy, and ScheduledActions

Each process can be in either RESUME or SUSPEND states, allowing to suspend activities of ASG on a specific instance, making it ‘Standby’ and then returning it to ‘InService’

20
Q

Which EC2 Auto Scaling process adds instances to ASG when the group scales out or for other reasons, such as adding instances to a warm pool?

A

“Launch” process

21
Q

Which EC2 Auto Scaling process adds instances to the attached load balancer target group when they are launched?

A

“AddToLoadBalancer” process

22
Q

Which EC2 Auto Scaling process removes instances from ASG when the group scales in or for other reasons, such as exceeding the maximum lifetime duration or failing a health check?

A

“Terminate” process

23
Q

Which EC2 Auto Scaling process accepts notifications from CloudWatch alarms associated with dynamic scaling policies?

A

“AlarmNotification” process

24
Q

Which EC2 Auto Scaling process balances the number of EC2 instances evenly across all specified AZs when the group becomes unbalanced, such as when a previously unavailable AZ returns to a healthy state?

A

“AZRebalance” process

25
Q

Which EC2 Auto Scaling process checks the health of instances and marks an instance as unhealthy if Amazon EC2 or ELB indicates the instance is unhealthy?

A

“HealthChecks” process

26
Q

Which EC2 Auto Scaling process terminates instances marked as unhealthy and then creates new instances to replace them?

A

“ReplaceUnhealthy” process

26
Q

Which EC2 Auto Scaling process terminates and replaces instances using the instance refresh feature?

A

“InstanceRefresh” process

27
Q

Which EC2 Auto Scaling process performs scheduled scaling actions created by you or generated when you create an AWS Auto Scaling scaling plan and enable predictive scaling?

A

“ScheduledActions” process

28
Q

Provide an example of EC2 status checks for ASG.

A
  • UNHEALTHY: Stopping, Stopped, Terminated, Shutting Down, or Impaired (not 2/2 checks passed)
  • HEALTHY: Running with 2/2 checks passed
29
Q

What health check types are available for ASG?

A
  • EC2 Status Checks (default)
  • ALB-provided Health Checks (can be enabled)
  • Custom Health Checks (can be configured)
30
Q

Which ASG attribute specifies the minimum amount of time (in seconds) to keep a new instance in service before terminating it if it is found to be unhealthy?

A

The Health Check Grace Period (default is 300 seconds)

31
Q

What happens to an instance when an ASG Lifecycle Hook pauses it?

A

The instance remains in a wait state until you complete the lifecycle action using the complete-lifecycle-action command, the CompleteLifecycleAction operation, or until the timeout period ends (default is one hour)

32
Q

Which ASG feature allows you to perform custom actions by pausing instances as they are launched or terminated?

A

ASG Lifecycle Hooks, which support integration with SNS for transition notifications and EventBridge to initiate other processes based on hooks

33
Q

How does the EC2 Auto Scaling state change when using ASG Lifecycle Hooks?

A

PENDING ->
PENDING: Wait ->
PENDING: Proceed ->
InService

Terminating -> Terminating: Wait -> Terminating: Proceed -> Terminated