Business Challenge
The previous post ended on suspended processes, which are the blunt instrument for stopping Auto Scaling interfering with an investigation: they apply to the whole group. Standby is the precise one. It takes a single instance out of service, leaves it in the group, and lets you work on it.
“Instances that are on standby are still part of the Auto Scaling group, but they do not actively handle load balancer traffic.” And the purpose is exactly what the previous ten posts kept running into: “This feature helps you stop and start the instances or reboot them without worrying about Amazon EC2 Auto Scaling terminating the instances as part of its health checks or during scale-in events.”
It works. The mechanism it uses to work is the thing to understand.
“Amazon EC2 Auto Scaling does not perform health checks on instances that are in a standby state. While the instance is in a standby state, its health status reflects the status that it had before you put it on standby.”
That is how standby protects the instance: there is no verdict to act on, because no verdict is being formed. But the stale status is still reported, and the documentation illustrates what that means with the sharpest example available:
“For example, if you put a healthy instance on standby and then terminate it, Amazon EC2 Auto Scaling continues to report the instance as healthy.”
A terminated instance, reported healthy, for as long as it stays in standby. Not a bug —
the status field means the last check, and the last check was before you started. But any
dashboard, script or alarm reading instance health from the group is reading a value that stopped
tracking reality the moment you called enter-standby.
The reckoning comes on the way back: “If you attempt to put a terminated instance that was on standby back in service, Amazon EC2 Auto Scaling performs a health check on the instance, determines that it is terminating and unhealthy, and launches a replacement instance.”
Entering standby takes an instance out of service, which leaves the group below its desired capacity — unless you say otherwise, Auto Scaling fixes that the only way it knows how:
“If you choose not to decrement the desired capacity of the Auto Scaling group, Amazon EC2 Auto Scaling launches an instance to replace the one on standby.” Against: “If you choose to decrement the desired capacity of the Auto Scaling group, this prevents the launch of an instance to replace the one on standby.”
The intent is sound — it keeps capacity up while you work. The consequence is that the default path leaves you paying for the instance you are debugging and its replacement, because of the other sentence on the page: “You are billed for instances that are in a standby state.”
In the CLI the decrement is an explicit flag,
--should-decrement-desired-capacity. In the console it is the
Replace instance checkbox, selected by default — so clicking through
gives you the replacement, and scripting without the flag gives you the same.
“After you put the instance back in service, the desired capacity is incremented to reflect how many instances are in the Auto Scaling group.” And then the constraint:
“To do the increment (and decrement), the new desired capacity must be between the minimum and maximum group size. Otherwise, the operation fails.”
So the return journey is not guaranteed. A group already at its maximum — because it scaled
out while your instance sat in standby — cannot increment, and
exit-standby fails. The instance stays in standby, still billed, still reporting
whatever status it had when you parked it.
The same rule applies on the way in: decrementing below the group's minimum fails too. A group of two with a minimum of two cannot have an instance put into standby with the decrement.
Architecture
What happens at the load balancer
The deregistration is the part of standby that actually removes traffic, and it is not instant: “If there is a load balancer target group or Classic Load Balancer attached to your Auto Scaling group, the instance is deregistered from the load balancer. If connection draining is enabled for the load balancer, Elastic Load Balancing waits 300 seconds by default before completing the deregistration process, which helps in-flight requests to complete.”
Five minutes of default drain, in other words, before the instance is actually out of rotation. For a planned patch that is exactly right. For an urgent investigation into an instance that is misbehaving under load, it means standby does not stop the traffic as fast as you probably expect, and the drain timeout is a load balancer setting rather than an Auto Scaling one.
On the way back the registration happens, but nothing in the documented flow waits for the instance
to pass a health check before Auto Scaling considers it InService — the health
check on exit is the one described in challenge 1, which determines whether the instance is viable
at all.
The four combinations
| Action | Desired capacity | What you end up with |
|---|---|---|
| Enter, decrement | Goes down by one | One instance parked, group at its new target |
| Enter, no decrement | Unchanged | Parked instance plus a replacement, both billed |
| Exit | Goes up by one | Instance back in service and registered |
| Exit, group at maximum | Cannot increment | Operation fails; instance stays in standby |
The second row is the one that surprises people, and the fourth is the one that strands an instance. Both follow from the same design decision: desired capacity is the thing standby manipulates, and desired capacity is bounded.
Rebalancing can move underneath you
“If at anytime after putting an instance on standby, or returning the instance to service
by exiting the standby state, your Auto Scaling group is found to not be balanced between
Availability Zones, Amazon EC2 Auto Scaling compensates by rebalancing the Availability Zones unless
you suspend the” AZRebalance process.
Taking one instance out of a three-zone group makes that group unbalanced by definition, so this is
not an edge case — it is the normal consequence of using standby on a balanced group. And it
connects straight to post #129: suspending AZRebalance is the documented way to stop
it, which means a careful standby workflow on a multi-zone group involves two operations rather than
one.
Worth remembering from that post what suspending AZRebalance does and does not do: it
stops redistribution after events like this one, but a scale-out or scale-in still tries to balance
zones on its own.
Standby against detach
“Detaching instances from an Auto Scaling group is similar to putting instances on standby.” The page puts them side by side, and the distinction is about what you intend to do next.
| Standby | Detach | |
|---|---|---|
| Still in the group | Yes | No |
| Still billed | Yes | Yes — it is still an EC2 instance |
| Health checks | Stopped, status frozen | Not applicable |
| Scale-in protection | Retained | Lost, per post #127 |
| Intended for | Patch or debug, then return | Move to another group, or run standalone |
The scale-in protection row is the one that decides it in practice. Post #127 found that detaching an instance loses its protection setting and reattaching inherits the group's. Standby does not do that, which makes standby the right tool whenever the instance is coming back.
The suspended-process equivalent
Post #129 noted that with Launch and Terminate suspended you can put an
instance into standby but cannot return it to service. The reason is now obvious: exiting standby
increments desired capacity and that is a Launch-side operation. Standby and suspended
processes overlap, and the overlap is one-directional — the suspension lets you park instances
and not retrieve them.
Why This Architecture Holds Up
Freezing the status is the only coherent option
The alternative is to keep running health checks on an instance you have deliberately taken out of service to reboot, which would mark it unhealthy for doing exactly what you asked it to do. Auto Scaling could report a third state — unknown — and arguably should, but the last-known value at least never claims to be current. The failure mode is in what reads it, not in what writes it.
Not decrementing by default protects the workload
The default is to keep capacity whole, which is the right choice for a feature whose stated purpose is maintenance on a running service. Someone patching one instance of twenty almost certainly wants the twenty to stay twenty. The cost of the extra instance is real and is the correct trade for not silently shrinking a production group.
Bounding the capacity change is right even when it strands an instance
An exit that could push desired capacity above the group's maximum would make the maximum advisory,
and post #129 already found one way for a group to exceed it. Failing the operation keeps the
maximum meaningful. It needs an alarm rather than a redesign, because a failed
exit-standby is both silent and billed.
Key Architecture Decisions
| Decision | Take | Why |
|---|---|---|
| Reading instance health during an investigation | Do not trust the group's health status | It is frozen at whatever it was before standby |
| Parking an instance to debug it | Decide the decrement deliberately | Without it you run and pay for a replacement too |
| Groups near their maximum size | Check headroom before entering standby | exit-standby fails if it cannot increment |
| Urgently pulling traffic from an instance | Expect the 300-second default drain | Deregistration waits for connection draining |
| Multi-zone groups | Suspend AZRebalance alongside |
Removing one instance unbalances the group by definition |
| Instance that is coming back | Standby, not detach | Detach loses scale-in protection; standby keeps it |
| Long investigations | Put an expiry on them | A standby instance is billed for as long as it sits there |
The audit worth running
-
Every instance currently in
Standby, and for how long. This is the standby equivalent of the never-resumed suspension from post #129, and it costs money the whole time. - Every group where the count of instances exceeds desired capacity, which is the signature of an instance entered into standby without the decrement.
-
Every monitoring query that reads
HealthStatusfromDescribeAutoScalingInstanceswithout also checkingLifecycleState— those are the ones reading a frozen value as a live one. -
Every group at or near
MaxSizewith an instance in standby, where the return journey is already blocked.
Closing Thought
Eleven posts into Auto Scaling, and standby is the one feature in the set whose surprising behaviour is not really about Auto Scaling at all. Freezing the health status is the correct thing for the service to do. The problem is downstream: a status field that means the last check gets read as the current state, and nothing in the field name says which.
The finding I would act on is the pairing of that frozen status with the billing sentence. An
instance parked for an investigation that nobody closed out keeps reporting the health it had on the
day it was parked, keeps costing what it cost, and keeps its slot in the group. The only thing that
distinguishes it from a working instance is LifecycleState, which is a field most
health dashboards never read.
That is the whole Auto Scaling series in one sentence, and a reasonable place to leave it: the service tells you the truth in a field you have to know to ask for.
Official AWS Reference
- Temporarily remove instances from your Auto Scaling group — that standby instances remain in the group but take no load balancer traffic, the stated purpose of stopping and rebooting without Auto Scaling terminating the instance, deregistration and the 300-second default connection draining wait, the desired-capacity decrement option and the replacement launched without it, the increment on return and the minimum and maximum bound that can fail either operation, that standby instances are billed, that health checks stop and the status freezes, the worked example of a terminated instance still reported healthy, what happens when you try to return it, the Availability Zone rebalancing that follows unless
AZRebalanceis suspended, and the comparison with detaching - Suspend and resume Amazon EC2 Auto Scaling processes — further reading on the
AZRebalancesuspension referenced above and on why a suspendedLaunchprevents a return from standby; no claims in this post are drawn from it - Detach or attach instances from your Auto Scaling group — further reading on the alternative the page compares standby with; no claims in this post are drawn from it
- Amazon EC2 Auto Scaling instance lifecycle — further reading on where
Standbysits among the lifecycle states; no claims in this post are drawn from it
Comments