AWS: Enable or Disable Instance Protection in an ASG
Description
Enable or disable "Protected from scale-in" on selected instances in an Auto Scaling Group (ASG). When protection is enabled, the ASG will not terminate these instances during scale-in events, which is useful when you are about to move an instance to Standby or terminate it in a controlled way. This action is useful for:
- Protecting an instance from scale-in before rotating it out of the ASG (e.g., before Enter Standby and Terminate)
- Ensuring a specific instance is not chosen for termination during automatic scale-in
- Building runbooks that combine with Describe Auto Scaling Instances, Enter Standby, and Terminate Instance in Auto Scaling Group for safe instance rotation
- Temporarily shielding instances during maintenance or troubleshooting
Instructions
Inputs
| Name | Description |
|---|---|
| Integration | Select a Workflow Integration or click New AWS Connection to establish a new one. |
| Auto Scaling Group Name | The name of the Auto Scaling Group that contains the instances. |
| Instance IDs | One or more EC2 instance IDs to set or clear protection for (comma-separated). Can be from a prior step (e.g., Describe Auto Scaling Instances) or from incident custom details. |
| AWS Region | The AWS region where the ASG is located. If left blank, the action uses us-east-1 as the default. |
| Protected From Scale In | Set to true to protect the instances from scale-in (recommended before rotating an instance out). Set to false to remove protection. |
Outputs
| Name | Description |
|---|---|
| ASG Name | The Auto Scaling Group that was targeted. |
| Protected | Array of instance IDs that were set to the requested protection state. |
| Protected From Scale In | The protection value that was applied (true or false). |
| Result | Whether the action succeeded: Success or Failed. |
| Result Summary | Brief description of what the action did or if it failed. |
| Error | Error message, if the action failed. |
Tips
- Instance Rotation: In a rotate-instance runbook, set Protected From Scale In = true before Enter Standby so the ASG does not select this instance for scale-in while you are rotating it out.
- Chaining Actions: Use Auto Scaling Group Name and Instance IDs from Auto Scaling: Describe Auto Scaling Instances (e.g.,
instances[0].asgName, and the same instance IDs) so the workflow works when the incident only provides an instance ID.
Updated 7 days ago
