AWS: Enable or Disable Instance Protection in an ASG

📘

Availability

This workflow action is available only to customers on PagerDuty Operations Cloud plans. See Operations Cloud pricing for more information.

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

  1. If you have not done so, follow the instructions to Create an Incident Workflow.
  2. When the instructions prompt you to add actions, select this action.
  3. Enter the following Inputs and click Save.
  4. Continue following instructions to Publish the Workflow.
  5. When the action runs, you will see the Outputs listed below.

Inputs

📘

Field References

Fields with the {+} icon accept Field References, which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click {+}, or enter {{, and select relevant fields. Refer to the Field References article for more information.

NameDescription
IntegrationSelect a Workflow Integration or click New AWS Connection to establish a new one.
Auto Scaling Group NameThe name of the Auto Scaling Group that contains the instances.
Instance IDsOne 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 RegionThe AWS region where the ASG is located. If left blank, the action uses us-east-1 as the default.
Protected From Scale InSet to true to protect the instances from scale-in (recommended before rotating an instance out). Set to false to remove protection.

Outputs

NameDescription
ASG NameThe Auto Scaling Group that was targeted.
ProtectedArray of instance IDs that were set to the requested protection state.
Protected From Scale InThe protection value that was applied (true or false).
ResultWhether the action succeeded: Success or Failed.
Result SummaryBrief description of what the action did or if it failed.
ErrorError 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.