Run an automation step by step
The following procedures describe how to use the AWS Systems Manager console and AWS Command Line Interface (AWS CLI) to run an automation using the manual execution mode. By using the manual execution mode, the automation starts in a Waiting status and pauses in the Waiting status between each step. This allows you to control when the automation proceeds, which is useful if you need to review the result of a step before continuing.
The automation runs in the context of the current user. This means that you don't need to configure additional IAM permissions as long as you have permission to use the runbook, and any actions called by the runbook. If you have administrator permissions in IAM, then you already have permission to run this automation.
Running an automation step by step (console)
The following procedure shows how to use the Systems Manager console to manually run an automation step by step.
To run an automation step by step
Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/
. -
In the navigation pane, choose Automation, and then choose Execute automation.
-
In the Automation document list, choose a runbook. Choose one or more options in the Document categories pane to filter SSM documents according to their purpose. To view a runbook that you own, choose the Owned by me tab. To view a runbook that is shared with your account, choose the Shared with me tab. To view all runbooks, choose the All documents tab.
Note
You can view information about a runbook by choosing the runbook name.
-
In the Document details section, verify that Document version is set to the version that you want to run. The system includes the following version options:
-
Default version at runtime – Choose this option if the Automation runbook is updated periodically and a new default version is assigned.
-
Latest version at runtime – Choose this option if the Automation runbook is updated periodically, and you want to run the version that was most recently updated.
-
1 (Default) – Choose this option to run the first version of the document, which is the default.
-
-
Choose Next.
-
In the Execution Mode section, choose Manual execution.
In the Input parameters section, specify the required inputs. Optionally, you can choose an IAM service role from the AutomationAssumeRole list.
-
Choose Execute.
-
Choose Execute this step when you're ready to start the first step of the automation. The automation proceeds with step one and pauses before running any subsequent steps specified in the runbook you chose in step 3 of this procedure. If the runbook has multiple steps, you must select Execute this step for each step for the automation to proceed. Each time you choose Execute this step the action runs.
Note
The console displays the status of the automation. If the automation fails to run a step, see Troubleshooting Systems Manager Automation.
-
After you complete all steps specified in the runbook, choose Complete and view results to finish the automation and view the results.
Running an automation step by step (command line)
The following procedure describes how to use the AWS CLI (on Linux, macOS, or Windows) or AWS Tools for PowerShell to manually run an automation step by step.
To run an automation step by step
Install and configure the AWS CLI or the AWS Tools for PowerShell, if you haven't already.
For information, see Installing or updating the latest version of the AWS CLI and Installing the AWS Tools for PowerShell.
-
Run the following command to start a manual automation. Replace each
example resource placeholder
with your own information.Here is an example using the runbook
AWS-RestartEC2Instance
to restart the specified EC2 instance.The system returns information like the following.
-
Run the following command when you're ready to start the first step of the automation. Replace each
example resource placeholder
with your own information. The automation proceeds with step one and pauses before running any subsequent steps specified in the runbook you chose in step 1 of this procedure. If the runbook has multiple steps, you must run the following command for each step for the automation to proceed.There is no output if the command succeeds.
-
Run the following command to retrieve the status of each step execution in the automation.
The system returns information like the following.
-
Run the following command to complete the automation after all steps specified within the chosen runbook have finished. Replace each
example resource placeholder
with your own information.There is no output if the command succeeds.