Skip to main content
In this lesson you’ll use AWS Systems Manager Automation to perform a simple remediation: automatically starting an Amazon EC2 instance by running a prebuilt automation runbook. Systems Manager Automation lets you create and execute runbooks (Automation documents) that perform a sequence of steps against AWS resources—ideal for repeatable remediation tasks and operational playbooks. What this demo covers
  • Use the AWS-managed Automation document AWS-StartEC2Instance to start a stopped EC2 instance.
  • Configure targets and execution role, launch the Automation, and monitor execution to confirm the instance transitions to the running state.
Prerequisite
  • You must have an EC2 instance in the stopped state that you intend to start.
Step-by-step
  1. Open the Systems Manager console. In the left navigation, expand Change Management Tools and choose Automation.
  2. Click Execute runbook and search for the AWS-managed document named AWS-StartEC2Instance. Type the name into the search box and press Enter.
A screenshot of the AWS Systems Manager Automation "Execute" page showing runbook categories on the left and an "Automation runbook" search box with a "Create runbook" button on the right. The top shows navigation tabs like "Owned by Amazon," "Owned by me," and "All runbooks."
  1. Select the AWS-StartEC2Instance document. This managed document encapsulates the required steps to call the EC2 StartInstances API on one or more instances.
A screenshot of the AWS Systems Manager console showing the "AWS-StartEC2Instance" document on the Description tab. The page displays Document version 1 and action buttons including "Execute automation" and "Delete."
  1. Click Execute automation and configure the runbook inputs:
    • Targets: Choose how to identify the instance(s) to start. You can target by instance ID (used in this demo), by tag, or by resource group. Confirm the selected instance ID matches the stopped instance you want to remediate.
    • Execution role: If the document requires it, provide an IAM role for Automation to assume. That role must include the necessary EC2 permissions, for example ec2:StartInstances.
    • Review any additional parameters the document exposes, then start the execution.
  2. Start the execution. The Automation runbook will call the EC2 StartInstances API with the provided instance ID(s) and begin the start operation.
This workflow demonstrates the standard remediation pattern:
  • Detect or identify the affected resource (stopped instance).
  • Pass the resource identifier to an automation runbook.
  • Let the runbook perform the corrective action (start the instance) automatically.
Monitoring the execution
  • The Automation console displays execution progress and per-step details (for example: Change Instance State → Start Instance).
  • As the runbook runs, the EC2 instance will transition to the running state and EC2 status checks will initialize while the instance boots.
  1. Monitor the execution status in Systems Manager until it completes. When finished, the Automation execution should report Success and each step should show as succeeded. Refresh the EC2 console to confirm the instance is running and status checks have passed.
A screenshot of the AWS EC2 Instances console showing one running instance named "WebServer" (t3.micro) with its instance ID and status displayed. The page includes controls for connecting, instance state, actions, and launching new instances.
Key considerations and tips
For Automation runbooks that operate via EC2 APIs (such as AWS-StartEC2Instance), the start action is invoked using the EC2 StartInstances API and does not require the SSM Agent on the target instance. However, the Automation execution must assume an IAM role with permission to call the EC2 actions it needs (for example, ec2:StartInstances)—you may need to supply an Execution role when executing the runbook. For other Systems Manager features that act directly on managed instances (Run Command, Session Manager, Patch Manager, etc.), the instance must have the SSM Agent installed, an instance profile with Systems Manager permissions (for example, AmazonSSMManagedInstanceCore), and network access to Systems Manager (or VPC endpoints for SSM).
Troubleshooting checklist
  • If the runbook fails with an authorization error, verify the execution role includes ec2:StartInstances and any other required permissions.
  • If the instance does not transition to running, check EC2 instance state, instance lifecycle, and system logs in the EC2 console.
  • Use Automation execution details and CloudTrail to investigate API calls made by the Automation runbook.
You can re-run the same Automation execution or start a new execution any time remediation is required. Automation runbooks help codify and repeat operational procedures, reduce manual intervention, and enforce consistent remediation across your AWS environment. Further reading and references

Watch Video

Practice Lab