Choosing an Automated Remediation Mechanism
This lesson explains how to choose the simplest reliable mechanism for automatically fixing each type of problem, closing the loop between detection and repair.
Learning outcomes
After completing this lesson, you will be able to:
- Choose a remediation mechanism for a problem.
- Configure AWS Config remediation.
- Design safe automation.
Choosing a remediation mechanism
AWS offers several mechanisms, and the best one depends on what detects the problem and what the fix involves. Built-in actions are simplest: an EC2 alarm action recovers or reboots an instance, an Auto Scaling policy adds capacity, and Auto Scaling health checks replace failed instances without any code. When the fix is a procedure, an Automation runbook started by EventBridge or Config gives auditable steps. Lambda suits fixes that need custom logic or third-party APIs, and Step Functions coordinates long or branching workflows with waits and human approval. The following table summarises the choices.
| Detected by | Fix | Mechanism |
|---|---|---|
| Instance system status check | Move to healthy hardware | CloudWatch alarm recover action |
| High load | Add capacity | Auto Scaling policy |
| Failed instance or application health check | Replace instance | Auto Scaling with ELB health checks |
| Non-compliant configuration | Reconfigure resource | AWS Config remediation with an Automation runbook |
| Alarm on disk space | Clean up logs on the node | EventBridge rule to Automation with aws:runCommand |
| Event needing custom logic | Call APIs or external systems | EventBridge rule to Lambda |
| Multi-step incident procedure | Ordered steps with approvals | Step Functions or Automation with aws:approve |
The following diagram matches each kind of problem with a mechanism.

Simplest remediation
AWS Config remediation
An AWS Config rule can have a remediation action, which is an Automation runbook with parameters (often the resource ID passed from the rule). Automatic remediation runs it whenever the resource becomes non-compliant, with a retry limit; manual remediation lets an operator run it from the console. Typical examples are enabling S3 default encryption, blocking public access, removing unrestricted SSH rules and setting log group retention. Remediation runbooks need an assume role with the necessary permissions. The compliance module covers Config rules in depth.
Designing safe automation
Automation that acts on production must be safe. The following practices appear in exam answers as the better option.
- Idempotence: running the fix twice must not cause harm, because events can be delivered more than once.
- Guard conditions: check tags or state before acting, for example skip instances tagged
DoNotTouch. - Rate control: limit concurrency and stop on errors.
- Least privilege: give the assume role only the actions the runbook needs.
- Notification: tell people what was changed, through SNS or an OpsItem.
- Human approval for destructive or high-impact steps.
Safe automation
Freeing disk space automatically
Application servers occasionally fill /var/log and crash. The CloudWatch agent publishes disk_used_percent. An alarm per instance at 90% would be hard to manage, so the team uses a Metrics Insights alarm that covers all instances in the CWAgent namespace. An EventBridge rule on the alarm state change starts a custom runbook. The runbook runs a Command document that compresses and removes rotated logs older than seven days, checks free space again with aws:runCommand, and creates an OpsItem if usage is still above 85%, so an engineer investigates the root cause.
How does an AWS Config rule fix a non-compliant resource automatically?
Show answer
With a remediation action that runs a Systems Manager Automation runbook.
Exam Tips
Remember for the exam
- Use built-in actions (recover, Auto Scaling) before custom automation.
- Config rules remediate non-compliant resources with Automation runbooks.
- Start runbooks from alarms through EventBridge.
- Make automation idempotent, rate-limited and least-privilege, with notifications.