Automating Runbooks and Incident Response
This lesson explains Systems Manager Automation runbooks, the events and schedules that trigger them, and how automation fits into an incident response process.
Learning outcomes
After completing this lesson, you will be able to:
- Describe what an Automation runbook can do and how it runs across accounts.
- Identify triggers for patching, remediation, recovery and scaling runbooks.
- Outline an incident response process supported by automation.
Systems Manager Automation runbooks
An Automation runbook is a document of steps that call AWS APIs, run scripts on instances, wait, branch on results and request approval. AWS provides hundreds of runbooks, such as AWS-RestartEC2Instance, AWS-PatchInstanceWithRollback and runbooks that disable public access to S3 buckets or security groups, and teams write their own. Runbooks run in one account or across accounts and Regions from a central account, with rate control (maximum concurrency and maximum errors), and every execution is logged for audit.
Triggers and incident tracking
Runbooks are started in several ways: EventBridge rules on alarms, findings and AWS service events; AWS Config remediation for non-compliant resources; maintenance windows and Patch Manager patch policies for scheduled patching; Auto Scaling lifecycle hooks; and operators who run the runbook linked to an OpsCenter OpsItem, which collects the related alarms, resources and history of an operational issue. Systems Manager Incident Manager is closed to new customers, so on-call paging and escalation use partner tools integrated through SNS or EventBridge.
| Operational task | Trigger | Example runbook action |
|---|---|---|
| Patching | Patch policy or maintenance window | Patch with rollback, in batches |
| Remediation | Config rule or Security Hub CSPM finding | Enable encryption or block public access |
| Recovery | CloudWatch alarm through EventBridge | Restart a service or replace an instance |
| Scaling | Schedule or event | Raise capacity before an announced event |
From alarm to runbook
Incident response practice
-
Detect
Alarms, anomaly detection, canaries and findings signal a problem.
-
Triage
An OpsItem or paging tool gathers context; the responder chooses the runbook.
-
Respond
Automation runs the fix, with approval for risky steps.
-
Recover and verify
Metrics confirm recovery; rollback steps run if not.
-
Learn
A post-incident review updates runbooks, alarms and automation.
Hung application processes
A Java application on 600 instances hangs every few days, and engineers restart the process by hand, sometimes at night.
A CloudWatch alarm on the application's health check publishes to EventBridge, which starts a custom runbook that captures a thread dump to S3, restarts the process and checks the health endpoint, creating an OpsItem if the restart does not help.
Rate control allows at most ten instances at a time and stops after five failures, and an approval step is required if more than 50 instances are affected, which signals a systemic problem rather than a single hung process.
Which service starts an Automation runbook automatically when a CloudWatch alarm changes state?
Show answer
Amazon EventBridge, with a rule that matches the alarm state change event and targets the runbook.
Exam Tips
Remember for the exam
- Automated, repeatable fixes on alarms: EventBridge rule that starts a Systems Manager Automation runbook.
- Fix non-compliant resources automatically: Config remediation with a runbook.
- Track operational issues with context: OpsCenter OpsItems.
- Incident Manager is closed to new customers; use partner paging tools for escalation.