Autoscaling Groups Flashcards
How are instances for ASGs configured?
Launch templates (old) or launch configurations (new: supports multiple versions and other goodies).
You specify an AMI, instance type, any EC2 user data, EBS volumes, sec groups, and an SSH key pair. Very similar configuration as with creating an EC2 instance.
The IAM role you attach to the ASG is assigned to EC2 instances it creates.
How does an ASG know when to scale in/out?
Based on CloudWatch alarms, or as a scheduled action.
Describe the three types of ASG scaling policies.
Target Tracking: Simple to set up. You specify CPU / request / Networkin / NetworkOut threhsolds and AWS manages your CloudWatch alarms for you.
Simple / Step scaling: Can have it create or remove multiple units when a CloudWatch alarm is triggered.
Scheduled Actions: scales on a schedule
How can you perform actions when an instance in an ASG is terminated or started?
There’s lifecycle hooks you can use to perform actions.
How do ASGs prevent instances from being spun up/down too quickly in succession?
There’s a default cooldown period of 300 seconds before new scaling actions can be triggered.
How does ASG decide what instance to terminate when scaling in?
Find the AZ with the most instances and terminate from that AZ. If there’s multiple instances to choose from, delete the one with the oldest launch configuration.