Automation system variables
AWS Systems Manager Automation runbooks use the following variables. For an example of how these
variables are used, view the JSON source of the AWS-UpdateWindowsAmi
runbook.
To view the JSON source of the AWS-UpdateWindowsAmi
runbook
Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/
. -
In the navigation pane, choose Documents.
-
In the document list, use either the Search bar or the numbers to the right of the Search bar to choose the runbook
AWS-UpdateWindowsAmi
. -
Choose the Content tab.
System variables
Automation runbooks support the following system variables.
Variable | Details |
---|---|
|
The AWS account ID of the user or role in which Automation runs. |
|
The date (at run time) in the format yyyy-MM-dd. |
|
The date and time (at run time) in the format yyyy-MM-dd_HH.mm.ss. |
|
The partition that the resource is in. For standard AWS Regions,
the partition is |
|
The Region that the runbook is run in. For example, us-east-2. |
Automation variables
Automation runbooks support the following automation variables.
Variable | Details |
---|---|
|
The unique identifier assigned to the current automation. For
example,
|
Terminology
The following terms describe how variables and parameters are resolved.
Term | Definition | Example |
---|---|---|
Constant ARN |
A valid Amazon Resource Name (ARN) without variables. |
|
Runbook parameter |
A parameter defined at the runbook level (for example,
|
|
System variable |
A general variable substituted into the runbook when any part of the runbook is evaluated. |
|
Automation variable |
A variable relating to the automation substituted into the runbook when any part of the runbook is evaluated. |
|
Systems Manager Parameter |
A variable defined within AWS Systems Manager Parameter Store. It can't be directly referenced in step input. Permissions might be required to access the parameter. |
|
Supported scenarios
Scenario | Comments | Example |
---|---|---|
Constant ARN |
An authorization check is performed to verify that the calling
user is permitted to pass the given
|
|
Runbook parameter supplied for |
Must be defined in the parameter list of the runbook. |
|
Value supplied for runbook parameter at start. |
Customer supplies the value to use for a parameter. Any inputs supplied at start time need to be defined in the parameter list of the runbook. |
Inputs to Start Automation Execution include : |
Systems Manager Parameter referenced within runbook content. |
The variable exists within the customer's account, or is a
publicly accessibly parameter, and the |
|
System variable referenced within step definition |
A system variable is substituted into the runbook when the automation is started. The value injected into the runbook is relative to when the substitution occurs. That is, the value of a time variable injected at step 1 is different from the value injected at step 3 because of the time it takes to run the steps between. System variables don't need to be set in the parameter list of the runbook. |
|
Automation variable referenced within step definition. |
Automation variables don't need to be set in the parameter list of the runbook. The only supported Automation variable is automation:EXECUTION_ID. |
|
Refer to output from previous step within next step definition. |
This is parameter redirection. The output of a previous step
is referenced using the syntax
|
|
Unsupported scenarios
Scenario | Comment | Example |
---|---|---|
Systems Manager Parameter supplied for |
Not supported. |
|
Systems Manager Parameter directly referenced in step input. |
Returns |
|
Variable step definition |
The definition of a step in the runbook is constructed by variables. |
|
Cross referencing runbook parameters |
The user supplies an input parameter at start time, which is a reference to another parameter in the runbook. |
|
Multi-level expansion |
The runbook defines a variable that evaluates to the name of a variable. This sits within the variable delimiters (that is {{ }}) and is expanded to the value of that variable/parameter. |
|
Referencing output from a runbook step that is a different variable type |
The user references the output from a preceding runbook step within a subsequent step. The output is a variable type that doesn't meet the requirements of the action in the subsequent step. |
|