...

/

ASG Instance Refresh and Warm Pools

ASG Instance Refresh and Warm Pools

Get introduced to two powerful AWS Auto Scaling Group (ASG) features such as instance refresh and warm pools.

We'll cover the following...

Scaling applications in the cloud isn’t just about adding more compute; it’s about doing it wisely. When traffic spikes or application versions need rolling updates, AWS Auto Scaling groups (ASGs) provide features like instance refresh and warm pools. These two mechanisms can greatly improve the agility and resilience of the workloads. This lesson explores both, with a practical, real-world focus that aligns directly with the DVA-C02 exam objectives.

Instance refresh

Instance refresh allows us to gradually replace EC2 instances in an ASG, using a rolling update strategy. This is especially important when we update configurations, user data, or launch templates. Instead of tearing down and building everything simultaneously, Instance refresh swaps out instances individually or in small batches, minimizing service disruptions.

This mechanism is fully managed and triggered manually or automatically, such as after a new launch template version is created. AWS handles the scheduling and pacing of the updates.

Why and when to use instance refresh

Instance refresh provides a reliable solution when updating critical elements of our EC2 infrastructure, such as OS or application versions, IAM roles or instance profiles, and launch templates. Rolling out patches or configuration changes manually can be risky and disruptive, especially in production environments. These updates are applied incrementally and safely using instance refresh, preserving application uptime while enforcing configuration consistency across our fleet.

How instance refresh works internally

Instance refresh operates as a managed, stepwise process that ensures high availability and stability during updates. Below is a high-level breakdown of the sequential steps involved:

  • Snapshot of current group: AWS captures the current configuration and state of the Auto Scaling group. This establishes a rollback baseline in case the refresh encounters issues.

  • Replace a subset of instances: Based on user-defined parameters, such as MinHealthyPercentage, AWS gradually replaces a portion of instances in controlled batches.

  • Health checks: Each new instance undergoes EC2 and ELB health checks. This ensures their integrity and operational readiness before the process moves to the next batch.

  • Rollback if failure threshold is reached: If too many new instances fail health checks or violate policy thresholds, Auto Scaling cancels the refresh and rolls back the group to its previously stable state.

Note: This is ...