Auto Scaling Group vocabulary
coreintermediateAn Auto Scaling Group keeps a fleet of instances at a target size — never below min, never above max, and always trying to reach desired — launching them from a launch template, and replacing any instance that fails a health check.
Think of it as
A thermostat for instance count: min and max are the hard floor and ceiling, desired is the target temperature, and the health check is what tells it a specific unit stopped working and needs swapping.
What we're doing: See how a lifecycle hook delays termination just long enough to drain in-flight requests.
- 1
- This hook fires before the instance is actually terminated, not after.
- 3
- The instance has up to 120 seconds in a "Terminating:Wait" state — enough time for in-flight requests to finish before the instance is actually removed.
Why this works: Without a lifecycle hook, Auto Scaling can terminate an instance mid-request — the hook creates a window for the instance (or an external process watching for the event) to finish current work and deregister cleanly first.
Setting desired capacity below min, or above max
Wrong
Better
What you see: The update is rejected, or desired capacity is silently clamped to the nearest valid bound.
Why: min, max, and desired have a fixed relationship (min ≤ desired ≤ max) that the API enforces — the three numbers are not independent settings, and updating one may require updating another in the same call.
- Minimum: 2 — the group never scales below this
- Desired: 4 — the active target
- Maximum: 10 — the group never scales above this
The three capacity numbers and what each one does
Together
Remember: min ≤ desired ≤ max bounds and targets group size; a launch template defines what launches; and a lifecycle hook creates a window to run custom logic before an instance is actually launched or terminated.
See also: target tracking and scaling policies · amis and image pipelines

