Menu
Amazon EC2 Systems Manager
User Guide

Additional Automation CLI Examples

You can manage other aspects of Automation execution using the following tasks.

Stop an Execution

Execute the following to stop a workflow. The command doesn't terminate associated instances.

Copy
aws ssm stop-automation-execution --automation-execution-id ID

Create Versions of Automation Documents

You can't change an existing automation document, but you can create a new version using the following command:

Copy
aws ssm update-document --name "patchWindowsAmi" --content file:///Users/test-user/Documents/patchWindowsAmi.json --document-version "\$LATEST"

Execute the following command to view details about the existing document versions:

Copy
aws ssm list-document-versions --name "patchWindowsAmi"

The command returns information like the following:

Copy
{ "DocumentVersions": [ { "IsDefaultVersion": false, "Name": "patchWindowsAmi", "DocumentVersion": "2", "CreatedDate": 1475799950.484 }, { "IsDefaultVersion": false, "Name": "patchWindowsAmi", "DocumentVersion": "1", "CreatedDate": 1475799931.064 } ] }

Execute the following command to update the default version for execution. The default execution version only changes when you explicitly set it to a new version. Creating a new document version does not change the default version.

Copy
aws ssm update-document-default-version --name patchWindowsAmi --document-version 2

Delete a Document

Execute the following command to delete an automation document:

Copy
aws ssm delete-document --name patchWindowsAMI