Lesson 3 of 3 Systems Manager Automation and Remediation

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 byFixMechanism
Instance system status checkMove to healthy hardwareCloudWatch alarm recover action
High loadAdd capacityAuto Scaling policy
Failed instance or application health checkReplace instanceAuto Scaling with ELB health checks
Non-compliant configurationReconfigure resourceAWS Config remediation with an Automation runbook
Alarm on disk spaceClean up logs on the nodeEventBridge rule to Automation with aws:runCommand
Event needing custom logicCall APIs or external systemsEventBridge rule to Lambda
Multi-step incident procedureOrdered steps with approvalsStep Functions or Automation with aws:approve

The following diagram matches each kind of problem with a mechanism.

Choosing a remediation mechanism. Built-in actions need no code: an alarm recover action for a failed system status check and Auto Scaling for high load. An Automation runbook started by EventBridge or Config gives auditable steps for a procedure. Lambda suits custom logic or third-party APIs, and Step Functions coordinates long or branching workflows with waits and approvals.
Prefer the simplest mechanism that fixes the problem: built-in actions first, code last.
Scenario questions

Simplest remediation

Exam skills 1.2.1 · 1.2.3

Choose the remediation mechanism with the least operational overhead.

Log in to try this activity Interactive activities are free with an account.

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.
Select all that apply

Safe automation

Exam skills 1.2.3 · 3.2.2

Identify the practices that make automated remediation safe.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

Check yourself

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.