Menu
AWS Systems Manager
API Reference (API Version 2014-11-06)

StartAutomationExecution

Initiates execution of an Automation document.

Request Syntax

{
   "ClientToken": "string",
   "DocumentName": "string",
   "DocumentVersion": "string",
   "MaxConcurrency": "string",
   "MaxErrors": "string",
   "Mode": "string",
   "Parameters": { 
      "string" : [ "string" ]
   },
   "TargetParameterName": "string",
   "Targets": [ 
      { 
         "Key": "string",
         "Values": [ "string" ]
      }
   ]
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ClientToken

User-provided idempotency token. The token must be unique, is case insensitive, enforces the UUID format, and can't be reused.

Type: String

Length Constraints: Fixed length of 36.

Pattern: [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}

Required: No

DocumentName

The name of the Automation document to use for this execution.

Type: String

Pattern: ^[a-zA-Z0-9_\-.:/]{3,128}$

Required: Yes

DocumentVersion

The version of the Automation document to use for this execution.

Type: String

Pattern: ([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)

Required: No

MaxConcurrency

The maximum number of targets allowed to run this task in parallel. You can specify a number, such as 10, or a percentage, such as 10%. The default value is 10.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 7.

Pattern: ^([1-9][0-9]*|[1-9][0-9]%|[1-9]%|100%)$

Required: No

MaxErrors

The number of errors that are allowed before the system stops running the automation on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops running the automation when the fourth error is received. If you specify 0, then the system stops running the automation on additional targets after the first error result is returned. If you run an automation on 50 resources and set max-errors to 10%, then the system stops running the automation on additional targets when the sixth error is received.

Executions that are already running an automation when max-errors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set max-concurrency to 1 so the executions proceed one at a time.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 7.

Pattern: ^([1-9][0-9]*|[0]|[1-9][0-9]%|[0-9]%|100%)$

Required: No

Mode

The execution mode of the automation. Valid modes include the following: Auto and Interactive. The default mode is Auto.

Type: String

Valid Values: Auto | Interactive

Required: No

Parameters

A key-value map of execution parameters, which match the declared parameters in the Automation document.

Type: String to array of strings map

Key Length Constraints: Minimum length of 1. Maximum length of 30.

Array Members: Minimum number of 0 items. Maximum number of 10 items.

Length Constraints: Minimum length of 1. Maximum length of 512.

Required: No

TargetParameterName

The name of the parameter used as the target resource for the rate-controlled execution. Required if you specify Targets.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 30.

Required: No

Targets

A key-value mapping to target resources. Required if you specify TargetParameterName.

Type: Array of Target objects

Array Members: Minimum number of 0 items. Maximum number of 5 items.

Required: No

Response Syntax

{
   "AutomationExecutionId": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

AutomationExecutionId

The unique ID of a newly scheduled automation execution.

Type: String

Length Constraints: Fixed length of 36.

Errors

For information about the errors that are common to all actions, see Common Errors.

AutomationDefinitionNotFoundException

An Automation document with the specified name could not be found.

HTTP Status Code: 400

AutomationDefinitionVersionNotFoundException

An Automation document with the specified name and version could not be found.

HTTP Status Code: 400

AutomationExecutionLimitExceededException

The number of simultaneously running Automation executions exceeded the allowable limit.

HTTP Status Code: 400

IdempotentParameterMismatch

Error returned when an idempotent operation is retried and the parameters don't match the original call to the API with the same idempotency token.

HTTP Status Code: 400

InternalServerError

An error occurred on the server side.

HTTP Status Code: 400

InvalidAutomationExecutionParametersException

The supplied parameters for invoking the specified Automation document are incorrect. For example, they may not match the set of parameters permitted for the specified Automation document.

HTTP Status Code: 400

InvalidTarget

The target is not valid or does not exist. It might not be configured for EC2 Systems Manager or you might not have permission to perform the operation.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: