ASG - Auto Scaling Group Flashcards
What does an ASG define regarding capacity?
defines a min, max and initial capacity of machines running
How are ASGs related to ELBs?
an ASGs automatically scales out or in instances to a load balancer
What can you use to create an ASG?
A launch template (newer and recommended) or a launch configuration or an EC2 instance
Based on what an ASG scale?
It can scale based on
- scaling policies
- CloudWatch alarms created from custom metrics sent
- based on a schedule
What you need to do to update an ASG?
u need to provide a new launch template / configuration
What happens to IAM roles attached to an ASG?
will get assigned to EC2 instances
What actions can be taken by an ASG if an ELB marks an instance as unhealthy
the ASG can terminate the unhealthy instance and hence replace it
Which are the ASG scaling policies?
- Target Tracking Scaling
- Simple / Step Scaling
- Scheduled Actions
Mention the Target Tracking Scaling policy concept
you want to keep something stable like:
avg ASG CPU to stay around 40%
Mention the ASG Simple / Step Scaling policy concept
you set max or min metric values to achieve like:
• When a CloudWatch alarm is triggered (example CPU > 70%), then add 2 units
• When a CloudWatch alarm is triggered (example CPU < 30%), then remove 1
What is the ASG Scaling Cooldown?
The cooldown period helps to ensure that your Auto Scaling group doesn’t launch or terminate additional instances before the previous scaling activity takes effect.
Can you define an ASG scaling cooldown?
yes, in addition to default cooldown, you can create cooldowns that apply to specific simple scaling policies
What is the default ASG default cooldown period?
5 minutes
What is the ASG Default Termination Policy?
- Find the AZ which has the most number of instances
- Delete the one with the oldest launch configuration
- Delete the one closest to the end of the billing period
• ASG tries the balance the number of instances across AZ by default
What does ASG Lifecycle Hooks allow you to do?
to perform extra steps before the instance goes in service (Pending state) and before the instance is terminated (Terminating state)