Amazon Simple Systems Manager (SSM)

2022/11/07 - Amazon Simple Systems Manager (SSM) - 11 updated api methods

Changes  This release includes support for applying a CloudWatch alarm to multi account multi region Systems Manager Automation

CreateAssociation (updated) Link ¶
Changes (request, response)
Request
{'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                          'IgnorePollAlarmFailure': 'boolean'}}}
Response
{'AssociationDescription': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                     'IgnorePollAlarmFailure': 'boolean'}}}}

A State Manager association defines the state that you want to maintain on your managed nodes. For example, an association can specify that anti-virus software must be installed and running on your managed nodes, or that certain ports must be closed. For static targets, the association specifies a schedule for when the configuration is reapplied. For dynamic targets, such as an Amazon Web Services resource group or an Amazon Web Services autoscaling group, State Manager, a capability of Amazon Web Services Systems Manager applies the configuration when new managed nodes are added to the group. The association also specifies actions to take when applying the configuration. For example, an association for anti-virus software might run once a day. If the software isn't installed, then State Manager installs it. If the software is installed, but the service isn't running, then the association might instruct State Manager to start the service.

See also: AWS API Documentation

Request Syntax

client.create_association(
    Name='string',
    DocumentVersion='string',
    InstanceId='string',
    Parameters={
        'string': [
            'string',
        ]
    },
    Targets=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    ScheduleExpression='string',
    OutputLocation={
        'S3Location': {
            'OutputS3Region': 'string',
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string'
        }
    },
    AssociationName='string',
    AutomationTargetParameterName='string',
    MaxErrors='string',
    MaxConcurrency='string',
    ComplianceSeverity='CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
    SyncCompliance='AUTO'|'MANUAL',
    ApplyOnlyAtCronInterval=True|False,
    CalendarNames=[
        'string',
    ],
    TargetLocations=[
        {
            'Accounts': [
                'string',
            ],
            'Regions': [
                'string',
            ],
            'TargetLocationMaxConcurrency': 'string',
            'TargetLocationMaxErrors': 'string',
            'ExecutionRoleName': 'string',
            'TargetLocationAlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            }
        },
    ],
    ScheduleOffset=123,
    TargetMaps=[
        {
            'string': [
                'string',
            ]
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    AlarmConfiguration={
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
)
type Name

string

param Name

[REQUIRED]

The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.

You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another account.

For Systems Manager documents (SSM documents) that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:

arn:partition:ssm:region:account-id:document/document-name

For example:

arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document

For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .

type DocumentVersion

string

param DocumentVersion

The document version you want to associate with the target(s). Can be a specific version or the default version.

Warning

State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the default version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to default .

type InstanceId

string

param InstanceId

The managed node ID.

Note

InstanceId has been deprecated. To specify a managed node ID for an association, use the Targets parameter. Requests that include the parameter InstanceID with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter InstanceId , you can't use the parameters AssociationName , DocumentVersion , MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use these parameters, you must use the Targets parameter.

type Parameters

dict

param Parameters

The parameters for the runtime configuration of the document.

  • (string) --

    • (list) --

      • (string) --

type Targets

list

param Targets

The targets for the association. You can target managed nodes by using tags, Amazon Web Services resource groups, all managed nodes in an Amazon Web Services account, or individual managed node IDs. You can target all managed nodes in an Amazon Web Services account by specifying the InstanceIds key with a value of * . For more information about choosing targets for an association, see Using targets and rate controls with State Manager associations in the Amazon Web Services Systems Manager User Guide .

  • (dict) --

    An array of search criteria that targets managed nodes using a key-value pair that you specify.

    Note

    One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

    Supported formats include the following.

    • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

    • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

    • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

    • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

    • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

    • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

    For example:

    • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

    • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

    • Key=tag-key,Values=Name,Instance-Type,CostCenter

    • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

    • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

    • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

    • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

    For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

    • Key (string) --

      User-defined criteria for sending commands that target managed nodes that meet the criteria.

    • Values (list) --

      User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

      Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

      • (string) --

type ScheduleExpression

string

param ScheduleExpression

A cron expression when the association will be applied to the target(s).

type OutputLocation

dict

param OutputLocation

An Amazon Simple Storage Service (Amazon S3) bucket where you want to store the output details of the request.

  • S3Location (dict) --

    An S3 bucket where you want to store the results of this request.

    • OutputS3Region (string) --

      The Amazon Web Services Region of the S3 bucket.

    • OutputS3BucketName (string) --

      The name of the S3 bucket.

    • OutputS3KeyPrefix (string) --

      The S3 bucket subfolder.

type AssociationName

string

param AssociationName

Specify a descriptive name for the association.

type AutomationTargetParameterName

string

param AutomationTargetParameterName

Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

type MaxErrors

string

param MaxErrors

The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

type MaxConcurrency

string

param MaxConcurrency

The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

type ComplianceSeverity

string

param ComplianceSeverity

The severity level to assign to the association.

type SyncCompliance

string

param SyncCompliance

The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager. It is managed by your direct call to the PutComplianceItems API operation.

By default, all associations use AUTO mode.

type ApplyOnlyAtCronInterval

boolean

param ApplyOnlyAtCronInterval

By default, when you create a new association, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

type CalendarNames

list

param CalendarNames

The names or Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

  • (string) --

type TargetLocations

list

param TargetLocations

A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to create an association in multiple Regions and multiple accounts.

  • (dict) --

    The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

    • Accounts (list) --

      The Amazon Web Services accounts targeted by the current Automation execution.

      • (string) --

    • Regions (list) --

      The Amazon Web Services Regions targeted by the current Automation execution.

      • (string) --

    • TargetLocationMaxConcurrency (string) --

      The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

    • TargetLocationMaxErrors (string) --

      The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

    • ExecutionRoleName (string) --

      The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

    • TargetLocationAlarmConfiguration (dict) --

      The details for the CloudWatch alarm you want to apply to an automation or command.

      • IgnorePollAlarmFailure (boolean) --

        If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

      • Alarms (list) -- [REQUIRED]

        The name of the CloudWatch alarm specified in the configuration.

        • (dict) --

          A CloudWatch alarm you apply to an automation or command.

          • Name (string) -- [REQUIRED]

            The name of your CloudWatch alarm.

type ScheduleOffset

integer

param ScheduleOffset

Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see Reference: Cron and rate expressions for Systems Manager in the Amazon Web Services Systems Manager User Guide .

Note

To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This option tells the system not to run an association immediately after you create it.

type TargetMaps

list

param TargetMaps

A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

  • (dict) --

    • (string) --

      • (list) --

        • (string) --

type Tags

list

param Tags

Adds or overwrites one or more tags for a State Manager association. Tags are metadata that you can assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define.

  • (dict) --

    Metadata that you assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Amazon Web Services Systems Manager, you can apply tags to Systems Manager documents (SSM documents), managed nodes, maintenance windows, parameters, patch baselines, OpsItems, and OpsMetadata.

    • Key (string) -- [REQUIRED]

      The name of the tag.

    • Value (string) -- [REQUIRED]

      The value of the tag.

type AlarmConfiguration

dict

param AlarmConfiguration

The details for the CloudWatch alarm you want to apply to an automation or command.

  • IgnorePollAlarmFailure (boolean) --

    If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

  • Alarms (list) -- [REQUIRED]

    The name of the CloudWatch alarm specified in the configuration.

    • (dict) --

      A CloudWatch alarm you apply to an automation or command.

      • Name (string) -- [REQUIRED]

        The name of your CloudWatch alarm.

rtype

dict

returns

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'AssociationVersion': 'string',
        'Date': datetime(2015, 1, 1),
        'LastUpdateAssociationDate': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        },
        'Overview': {
            'Status': 'string',
            'DetailedStatus': 'string',
            'AssociationStatusAggregatedCount': {
                'string': 123
            }
        },
        'DocumentVersion': 'string',
        'AutomationTargetParameterName': 'string',
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'AssociationId': 'string',
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'ScheduleExpression': 'string',
        'OutputLocation': {
            'S3Location': {
                'OutputS3Region': 'string',
                'OutputS3BucketName': 'string',
                'OutputS3KeyPrefix': 'string'
            }
        },
        'LastExecutionDate': datetime(2015, 1, 1),
        'LastSuccessfulExecutionDate': datetime(2015, 1, 1),
        'AssociationName': 'string',
        'MaxErrors': 'string',
        'MaxConcurrency': 'string',
        'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
        'SyncCompliance': 'AUTO'|'MANUAL',
        'ApplyOnlyAtCronInterval': True|False,
        'CalendarNames': [
            'string',
        ],
        'TargetLocations': [
            {
                'Accounts': [
                    'string',
                ],
                'Regions': [
                    'string',
                ],
                'TargetLocationMaxConcurrency': 'string',
                'TargetLocationMaxErrors': 'string',
                'ExecutionRoleName': 'string',
                'TargetLocationAlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
        ],
        'ScheduleOffset': 123,
        'TargetMaps': [
            {
                'string': [
                    'string',
                ]
            },
        ],
        'AlarmConfiguration': {
            'IgnorePollAlarmFailure': True|False,
            'Alarms': [
                {
                    'Name': 'string'
                },
            ]
        },
        'TriggeredAlarms': [
            {
                'Name': 'string',
                'State': 'UNKNOWN'|'ALARM'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      Information about the association.

      • Name (string) --

        The name of the SSM document.

      • InstanceId (string) --

        The managed node ID.

      • AssociationVersion (string) --

        The association version.

      • Date (datetime) --

        The date when the association was made.

      • LastUpdateAssociationDate (datetime) --

        The date when the association was last updated.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.

      • Overview (dict) --

        Information about the association.

        • Status (string) --

          The status of the association. Status can be: Pending, Success, or Failed.

        • DetailedStatus (string) --

          A detailed status of the association.

        • AssociationStatusAggregatedCount (dict) --

          Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.

          • (string) --

            • (integer) --

      • DocumentVersion (string) --

        The document version.

      • AutomationTargetParameterName (string) --

        Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

      • Parameters (dict) --

        A description of the parameters for a document.

        • (string) --

          • (list) --

            • (string) --

      • AssociationId (string) --

        The association ID.

      • Targets (list) --

        The managed nodes targeted by the request.

        • (dict) --

          An array of search criteria that targets managed nodes using a key-value pair that you specify.

          Note

          One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

          Supported formats include the following.

          • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

          • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

          • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

          • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

          For example:

          • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

          • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

          • Key=tag-key,Values=Name,Instance-Type,CostCenter

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

          • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

          • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

          For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

          • Key (string) --

            User-defined criteria for sending commands that target managed nodes that meet the criteria.

          • Values (list) --

            User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

            Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

            • (string) --

      • ScheduleExpression (string) --

        A cron expression that specifies a schedule when the association runs.

      • OutputLocation (dict) --

        An S3 bucket where you want to store the output details of the request.

        • S3Location (dict) --

          An S3 bucket where you want to store the results of this request.

          • OutputS3Region (string) --

            The Amazon Web Services Region of the S3 bucket.

          • OutputS3BucketName (string) --

            The name of the S3 bucket.

          • OutputS3KeyPrefix (string) --

            The S3 bucket subfolder.

      • LastExecutionDate (datetime) --

        The date on which the association was last run.

      • LastSuccessfulExecutionDate (datetime) --

        The last date on which the association was successfully run.

      • AssociationName (string) --

        The association name.

      • MaxErrors (string) --

        The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

        Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

      • MaxConcurrency (string) --

        The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

        If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

      • ComplianceSeverity (string) --

        The severity level that is assigned to the association.

      • SyncCompliance (string) --

        The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

        In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

        By default, all associations use AUTO mode.

      • ApplyOnlyAtCronInterval (boolean) --

        By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

      • CalendarNames (list) --

        The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

        • (string) --

      • TargetLocations (list) --

        The combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association.

        • (dict) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

          • Accounts (list) --

            The Amazon Web Services accounts targeted by the current Automation execution.

            • (string) --

          • Regions (list) --

            The Amazon Web Services Regions targeted by the current Automation execution.

            • (string) --

          • TargetLocationMaxConcurrency (string) --

            The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

          • TargetLocationMaxErrors (string) --

            The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

          • ExecutionRoleName (string) --

            The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

          • TargetLocationAlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

      • ScheduleOffset (integer) --

        Number of days to wait after the scheduled day to run an association.

      • TargetMaps (list) --

        A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

        • (dict) --

          • (string) --

            • (list) --

              • (string) --

      • AlarmConfiguration (dict) --

        The details for the CloudWatch alarm you want to apply to an automation or command.

        • IgnorePollAlarmFailure (boolean) --

          If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

        • Alarms (list) --

          The name of the CloudWatch alarm specified in the configuration.

          • (dict) --

            A CloudWatch alarm you apply to an automation or command.

            • Name (string) --

              The name of your CloudWatch alarm.

      • TriggeredAlarms (list) --

        The CloudWatch alarm that was invoked during the association.

        • (dict) --

          The details about the state of your CloudWatch alarm.

          • Name (string) --

            The name of your CloudWatch alarm.

          • State (string) --

            The state of your CloudWatch alarm.

CreateAssociationBatch (updated) Link ¶
Changes (request, response)
Request
{'Entries': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                      'IgnorePollAlarmFailure': 'boolean'}}}}
Response
{'Failed': {'Entry': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                               'IgnorePollAlarmFailure': 'boolean'}}}},
 'Successful': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                         'IgnorePollAlarmFailure': 'boolean'}}}}

Associates the specified Amazon Web Services Systems Manager document (SSM document) with the specified managed nodes or targets.

When you associate a document with one or more managed nodes using IDs or tags, Amazon Web Services Systems Manager Agent (SSM Agent) running on the managed node processes the document and configures the node as specified.

If you associate a document with a managed node that already has an associated document, the system returns the AssociationAlreadyExists exception.

See also: AWS API Documentation

Request Syntax

client.create_association_batch(
    Entries=[
        {
            'Name': 'string',
            'InstanceId': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'AutomationTargetParameterName': 'string',
            'DocumentVersion': 'string',
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'ScheduleExpression': 'string',
            'OutputLocation': {
                'S3Location': {
                    'OutputS3Region': 'string',
                    'OutputS3BucketName': 'string',
                    'OutputS3KeyPrefix': 'string'
                }
            },
            'AssociationName': 'string',
            'MaxErrors': 'string',
            'MaxConcurrency': 'string',
            'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
            'SyncCompliance': 'AUTO'|'MANUAL',
            'ApplyOnlyAtCronInterval': True|False,
            'CalendarNames': [
                'string',
            ],
            'TargetLocations': [
                {
                    'Accounts': [
                        'string',
                    ],
                    'Regions': [
                        'string',
                    ],
                    'TargetLocationMaxConcurrency': 'string',
                    'TargetLocationMaxErrors': 'string',
                    'ExecutionRoleName': 'string',
                    'TargetLocationAlarmConfiguration': {
                        'IgnorePollAlarmFailure': True|False,
                        'Alarms': [
                            {
                                'Name': 'string'
                            },
                        ]
                    }
                },
            ],
            'ScheduleOffset': 123,
            'TargetMaps': [
                {
                    'string': [
                        'string',
                    ]
                },
            ],
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            }
        },
    ]
)
type Entries

list

param Entries

[REQUIRED]

One or more associations.

  • (dict) --

    Describes the association of a Amazon Web Services Systems Manager document (SSM document) and a managed node.

    • Name (string) -- [REQUIRED]

      The name of the SSM document that contains the configuration information for the managed node. You can specify Command or Automation runbooks.

      You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another account.

      For SSM documents that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:

      arn:aws:ssm:region:account-id:document/document-name

      For example:

      arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document

      For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .

    • InstanceId (string) --

      The managed node ID.

      Note

      InstanceId has been deprecated. To specify a managed node ID for an association, use the Targets parameter. Requests that include the parameter InstanceID with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter InstanceId , you can't use the parameters AssociationName , DocumentVersion , MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use these parameters, you must use the Targets parameter.

    • Parameters (dict) --

      A description of the parameters for a document.

      • (string) --

        • (list) --

          • (string) --

    • AutomationTargetParameterName (string) --

      Specify the target for the association. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

    • DocumentVersion (string) --

      The document version.

    • Targets (list) --

      The managed nodes targeted by the request.

      • (dict) --

        An array of search criteria that targets managed nodes using a key-value pair that you specify.

        Note

        One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

        Supported formats include the following.

        • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

        • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

        • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

        • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

        • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

        • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

        For example:

        • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

        • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

        • Key=tag-key,Values=Name,Instance-Type,CostCenter

        • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

        • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

        • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

        • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

        For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

        • Key (string) --

          User-defined criteria for sending commands that target managed nodes that meet the criteria.

        • Values (list) --

          User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

          Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

          • (string) --

    • ScheduleExpression (string) --

      A cron expression that specifies a schedule when the association runs.

    • OutputLocation (dict) --

      An S3 bucket where you want to store the results of this request.

      • S3Location (dict) --

        An S3 bucket where you want to store the results of this request.

        • OutputS3Region (string) --

          The Amazon Web Services Region of the S3 bucket.

        • OutputS3BucketName (string) --

          The name of the S3 bucket.

        • OutputS3KeyPrefix (string) --

          The S3 bucket subfolder.

    • AssociationName (string) --

      Specify a descriptive name for the association.

    • MaxErrors (string) --

      The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

      Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

    • MaxConcurrency (string) --

      The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

      If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

    • ComplianceSeverity (string) --

      The severity level to assign to the association.

    • SyncCompliance (string) --

      The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

      In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

      By default, all associations use AUTO mode.

    • ApplyOnlyAtCronInterval (boolean) --

      By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

    • CalendarNames (list) --

      The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that Change Calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

      • (string) --

    • TargetLocations (list) --

      Use this action to create an association in multiple Regions and multiple accounts.

      • (dict) --

        The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

        • Accounts (list) --

          The Amazon Web Services accounts targeted by the current Automation execution.

          • (string) --

        • Regions (list) --

          The Amazon Web Services Regions targeted by the current Automation execution.

          • (string) --

        • TargetLocationMaxConcurrency (string) --

          The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

        • TargetLocationMaxErrors (string) --

          The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

        • ExecutionRoleName (string) --

          The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

        • TargetLocationAlarmConfiguration (dict) --

          The details for the CloudWatch alarm you want to apply to an automation or command.

          • IgnorePollAlarmFailure (boolean) --

            If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

          • Alarms (list) -- [REQUIRED]

            The name of the CloudWatch alarm specified in the configuration.

            • (dict) --

              A CloudWatch alarm you apply to an automation or command.

              • Name (string) -- [REQUIRED]

                The name of your CloudWatch alarm.

    • ScheduleOffset (integer) --

      Number of days to wait after the scheduled day to run an association.

    • TargetMaps (list) --

      A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

      • (dict) --

        • (string) --

          • (list) --

            • (string) --

    • AlarmConfiguration (dict) --

      The details for the CloudWatch alarm you want to apply to an automation or command.

      • IgnorePollAlarmFailure (boolean) --

        If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

      • Alarms (list) -- [REQUIRED]

        The name of the CloudWatch alarm specified in the configuration.

        • (dict) --

          A CloudWatch alarm you apply to an automation or command.

          • Name (string) -- [REQUIRED]

            The name of your CloudWatch alarm.

rtype

dict

returns

Response Syntax

{
    'Successful': [
        {
            'Name': 'string',
            'InstanceId': 'string',
            'AssociationVersion': 'string',
            'Date': datetime(2015, 1, 1),
            'LastUpdateAssociationDate': datetime(2015, 1, 1),
            'Status': {
                'Date': datetime(2015, 1, 1),
                'Name': 'Pending'|'Success'|'Failed',
                'Message': 'string',
                'AdditionalInfo': 'string'
            },
            'Overview': {
                'Status': 'string',
                'DetailedStatus': 'string',
                'AssociationStatusAggregatedCount': {
                    'string': 123
                }
            },
            'DocumentVersion': 'string',
            'AutomationTargetParameterName': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'AssociationId': 'string',
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'ScheduleExpression': 'string',
            'OutputLocation': {
                'S3Location': {
                    'OutputS3Region': 'string',
                    'OutputS3BucketName': 'string',
                    'OutputS3KeyPrefix': 'string'
                }
            },
            'LastExecutionDate': datetime(2015, 1, 1),
            'LastSuccessfulExecutionDate': datetime(2015, 1, 1),
            'AssociationName': 'string',
            'MaxErrors': 'string',
            'MaxConcurrency': 'string',
            'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
            'SyncCompliance': 'AUTO'|'MANUAL',
            'ApplyOnlyAtCronInterval': True|False,
            'CalendarNames': [
                'string',
            ],
            'TargetLocations': [
                {
                    'Accounts': [
                        'string',
                    ],
                    'Regions': [
                        'string',
                    ],
                    'TargetLocationMaxConcurrency': 'string',
                    'TargetLocationMaxErrors': 'string',
                    'ExecutionRoleName': 'string',
                    'TargetLocationAlarmConfiguration': {
                        'IgnorePollAlarmFailure': True|False,
                        'Alarms': [
                            {
                                'Name': 'string'
                            },
                        ]
                    }
                },
            ],
            'ScheduleOffset': 123,
            'TargetMaps': [
                {
                    'string': [
                        'string',
                    ]
                },
            ],
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            },
            'TriggeredAlarms': [
                {
                    'Name': 'string',
                    'State': 'UNKNOWN'|'ALARM'
                },
            ]
        },
    ],
    'Failed': [
        {
            'Entry': {
                'Name': 'string',
                'InstanceId': 'string',
                'Parameters': {
                    'string': [
                        'string',
                    ]
                },
                'AutomationTargetParameterName': 'string',
                'DocumentVersion': 'string',
                'Targets': [
                    {
                        'Key': 'string',
                        'Values': [
                            'string',
                        ]
                    },
                ],
                'ScheduleExpression': 'string',
                'OutputLocation': {
                    'S3Location': {
                        'OutputS3Region': 'string',
                        'OutputS3BucketName': 'string',
                        'OutputS3KeyPrefix': 'string'
                    }
                },
                'AssociationName': 'string',
                'MaxErrors': 'string',
                'MaxConcurrency': 'string',
                'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
                'SyncCompliance': 'AUTO'|'MANUAL',
                'ApplyOnlyAtCronInterval': True|False,
                'CalendarNames': [
                    'string',
                ],
                'TargetLocations': [
                    {
                        'Accounts': [
                            'string',
                        ],
                        'Regions': [
                            'string',
                        ],
                        'TargetLocationMaxConcurrency': 'string',
                        'TargetLocationMaxErrors': 'string',
                        'ExecutionRoleName': 'string',
                        'TargetLocationAlarmConfiguration': {
                            'IgnorePollAlarmFailure': True|False,
                            'Alarms': [
                                {
                                    'Name': 'string'
                                },
                            ]
                        }
                    },
                ],
                'ScheduleOffset': 123,
                'TargetMaps': [
                    {
                        'string': [
                            'string',
                        ]
                    },
                ],
                'AlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
            'Message': 'string',
            'Fault': 'Client'|'Server'|'Unknown'
        },
    ]
}

Response Structure

  • (dict) --

    • Successful (list) --

      Information about the associations that succeeded.

      • (dict) --

        Describes the parameters for a document.

        • Name (string) --

          The name of the SSM document.

        • InstanceId (string) --

          The managed node ID.

        • AssociationVersion (string) --

          The association version.

        • Date (datetime) --

          The date when the association was made.

        • LastUpdateAssociationDate (datetime) --

          The date when the association was last updated.

        • Status (dict) --

          The association status.

          • Date (datetime) --

            The date when the status changed.

          • Name (string) --

            The status.

          • Message (string) --

            The reason for the status.

          • AdditionalInfo (string) --

            A user-defined string.

        • Overview (dict) --

          Information about the association.

          • Status (string) --

            The status of the association. Status can be: Pending, Success, or Failed.

          • DetailedStatus (string) --

            A detailed status of the association.

          • AssociationStatusAggregatedCount (dict) --

            Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.

            • (string) --

              • (integer) --

        • DocumentVersion (string) --

          The document version.

        • AutomationTargetParameterName (string) --

          Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

        • Parameters (dict) --

          A description of the parameters for a document.

          • (string) --

            • (list) --

              • (string) --

        • AssociationId (string) --

          The association ID.

        • Targets (list) --

          The managed nodes targeted by the request.

          • (dict) --

            An array of search criteria that targets managed nodes using a key-value pair that you specify.

            Note

            One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

            Supported formats include the following.

            • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

            • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

            • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

            • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

            For example:

            • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

            • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

            • Key=tag-key,Values=Name,Instance-Type,CostCenter

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

            • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

            • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

            For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

            • Key (string) --

              User-defined criteria for sending commands that target managed nodes that meet the criteria.

            • Values (list) --

              User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

              Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

              • (string) --

        • ScheduleExpression (string) --

          A cron expression that specifies a schedule when the association runs.

        • OutputLocation (dict) --

          An S3 bucket where you want to store the output details of the request.

          • S3Location (dict) --

            An S3 bucket where you want to store the results of this request.

            • OutputS3Region (string) --

              The Amazon Web Services Region of the S3 bucket.

            • OutputS3BucketName (string) --

              The name of the S3 bucket.

            • OutputS3KeyPrefix (string) --

              The S3 bucket subfolder.

        • LastExecutionDate (datetime) --

          The date on which the association was last run.

        • LastSuccessfulExecutionDate (datetime) --

          The last date on which the association was successfully run.

        • AssociationName (string) --

          The association name.

        • MaxErrors (string) --

          The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

          Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

        • MaxConcurrency (string) --

          The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

          If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

        • ComplianceSeverity (string) --

          The severity level that is assigned to the association.

        • SyncCompliance (string) --

          The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

          In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

          By default, all associations use AUTO mode.

        • ApplyOnlyAtCronInterval (boolean) --

          By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

        • CalendarNames (list) --

          The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

          • (string) --

        • TargetLocations (list) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association.

          • (dict) --

            The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

            • Accounts (list) --

              The Amazon Web Services accounts targeted by the current Automation execution.

              • (string) --

            • Regions (list) --

              The Amazon Web Services Regions targeted by the current Automation execution.

              • (string) --

            • TargetLocationMaxConcurrency (string) --

              The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

            • TargetLocationMaxErrors (string) --

              The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

            • ExecutionRoleName (string) --

              The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

            • TargetLocationAlarmConfiguration (dict) --

              The details for the CloudWatch alarm you want to apply to an automation or command.

              • IgnorePollAlarmFailure (boolean) --

                If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

              • Alarms (list) --

                The name of the CloudWatch alarm specified in the configuration.

                • (dict) --

                  A CloudWatch alarm you apply to an automation or command.

                  • Name (string) --

                    The name of your CloudWatch alarm.

        • ScheduleOffset (integer) --

          Number of days to wait after the scheduled day to run an association.

        • TargetMaps (list) --

          A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

          • (dict) --

            • (string) --

              • (list) --

                • (string) --

        • AlarmConfiguration (dict) --

          The details for the CloudWatch alarm you want to apply to an automation or command.

          • IgnorePollAlarmFailure (boolean) --

            If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

          • Alarms (list) --

            The name of the CloudWatch alarm specified in the configuration.

            • (dict) --

              A CloudWatch alarm you apply to an automation or command.

              • Name (string) --

                The name of your CloudWatch alarm.

        • TriggeredAlarms (list) --

          The CloudWatch alarm that was invoked during the association.

          • (dict) --

            The details about the state of your CloudWatch alarm.

            • Name (string) --

              The name of your CloudWatch alarm.

            • State (string) --

              The state of your CloudWatch alarm.

    • Failed (list) --

      Information about the associations that failed.

      • (dict) --

        Describes a failed association.

        • Entry (dict) --

          The association.

          • Name (string) --

            The name of the SSM document that contains the configuration information for the managed node. You can specify Command or Automation runbooks.

            You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another account.

            For SSM documents that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:

            arn:aws:ssm:region:account-id:document/document-name

            For example:

            arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document

            For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .

          • InstanceId (string) --

            The managed node ID.

            Note

            InstanceId has been deprecated. To specify a managed node ID for an association, use the Targets parameter. Requests that include the parameter InstanceID with Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail. In addition, if you use the parameter InstanceId , you can't use the parameters AssociationName , DocumentVersion , MaxErrors , MaxConcurrency , OutputLocation , or ScheduleExpression . To use these parameters, you must use the Targets parameter.

          • Parameters (dict) --

            A description of the parameters for a document.

            • (string) --

              • (list) --

                • (string) --

          • AutomationTargetParameterName (string) --

            Specify the target for the association. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

          • DocumentVersion (string) --

            The document version.

          • Targets (list) --

            The managed nodes targeted by the request.

            • (dict) --

              An array of search criteria that targets managed nodes using a key-value pair that you specify.

              Note

              One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

              Supported formats include the following.

              • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

              • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

              • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

              • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

              • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

              • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

              For example:

              • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

              • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

              • Key=tag-key,Values=Name,Instance-Type,CostCenter

              • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

              • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

              • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

              • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

              For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

              • Key (string) --

                User-defined criteria for sending commands that target managed nodes that meet the criteria.

              • Values (list) --

                User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

                Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

                • (string) --

          • ScheduleExpression (string) --

            A cron expression that specifies a schedule when the association runs.

          • OutputLocation (dict) --

            An S3 bucket where you want to store the results of this request.

            • S3Location (dict) --

              An S3 bucket where you want to store the results of this request.

              • OutputS3Region (string) --

                The Amazon Web Services Region of the S3 bucket.

              • OutputS3BucketName (string) --

                The name of the S3 bucket.

              • OutputS3KeyPrefix (string) --

                The S3 bucket subfolder.

          • AssociationName (string) --

            Specify a descriptive name for the association.

          • MaxErrors (string) --

            The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

            Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

          • MaxConcurrency (string) --

            The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

            If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

          • ComplianceSeverity (string) --

            The severity level to assign to the association.

          • SyncCompliance (string) --

            The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

            In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

            By default, all associations use AUTO mode.

          • ApplyOnlyAtCronInterval (boolean) --

            By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

          • CalendarNames (list) --

            The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that Change Calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

            • (string) --

          • TargetLocations (list) --

            Use this action to create an association in multiple Regions and multiple accounts.

            • (dict) --

              The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

              • Accounts (list) --

                The Amazon Web Services accounts targeted by the current Automation execution.

                • (string) --

              • Regions (list) --

                The Amazon Web Services Regions targeted by the current Automation execution.

                • (string) --

              • TargetLocationMaxConcurrency (string) --

                The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

              • TargetLocationMaxErrors (string) --

                The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

              • ExecutionRoleName (string) --

                The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

              • TargetLocationAlarmConfiguration (dict) --

                The details for the CloudWatch alarm you want to apply to an automation or command.

                • IgnorePollAlarmFailure (boolean) --

                  If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

                • Alarms (list) --

                  The name of the CloudWatch alarm specified in the configuration.

                  • (dict) --

                    A CloudWatch alarm you apply to an automation or command.

                    • Name (string) --

                      The name of your CloudWatch alarm.

          • ScheduleOffset (integer) --

            Number of days to wait after the scheduled day to run an association.

          • TargetMaps (list) --

            A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

            • (dict) --

              • (string) --

                • (list) --

                  • (string) --

          • AlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

        • Message (string) --

          A description of the failure.

        • Fault (string) --

          The source of the failure.

DescribeAssociation (updated) Link ¶
Changes (response)
{'AssociationDescription': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                     'IgnorePollAlarmFailure': 'boolean'}}}}

Describes the association for the specified target or managed node. If you created the association by using the Targets parameter, then you must retrieve the association by using the association ID.

See also: AWS API Documentation

Request Syntax

client.describe_association(
    Name='string',
    InstanceId='string',
    AssociationId='string',
    AssociationVersion='string'
)
type Name

string

param Name

The name of the SSM document.

type InstanceId

string

param InstanceId

The managed node ID.

type AssociationId

string

param AssociationId

The association ID for which you want information.

type AssociationVersion

string

param AssociationVersion

Specify the association version to retrieve. To view the latest version, either specify $LATEST for this parameter, or omit this parameter. To view a list of all associations for a managed node, use ListAssociations. To get a list of versions for a specific association, use ListAssociationVersions.

rtype

dict

returns

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'AssociationVersion': 'string',
        'Date': datetime(2015, 1, 1),
        'LastUpdateAssociationDate': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        },
        'Overview': {
            'Status': 'string',
            'DetailedStatus': 'string',
            'AssociationStatusAggregatedCount': {
                'string': 123
            }
        },
        'DocumentVersion': 'string',
        'AutomationTargetParameterName': 'string',
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'AssociationId': 'string',
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'ScheduleExpression': 'string',
        'OutputLocation': {
            'S3Location': {
                'OutputS3Region': 'string',
                'OutputS3BucketName': 'string',
                'OutputS3KeyPrefix': 'string'
            }
        },
        'LastExecutionDate': datetime(2015, 1, 1),
        'LastSuccessfulExecutionDate': datetime(2015, 1, 1),
        'AssociationName': 'string',
        'MaxErrors': 'string',
        'MaxConcurrency': 'string',
        'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
        'SyncCompliance': 'AUTO'|'MANUAL',
        'ApplyOnlyAtCronInterval': True|False,
        'CalendarNames': [
            'string',
        ],
        'TargetLocations': [
            {
                'Accounts': [
                    'string',
                ],
                'Regions': [
                    'string',
                ],
                'TargetLocationMaxConcurrency': 'string',
                'TargetLocationMaxErrors': 'string',
                'ExecutionRoleName': 'string',
                'TargetLocationAlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
        ],
        'ScheduleOffset': 123,
        'TargetMaps': [
            {
                'string': [
                    'string',
                ]
            },
        ],
        'AlarmConfiguration': {
            'IgnorePollAlarmFailure': True|False,
            'Alarms': [
                {
                    'Name': 'string'
                },
            ]
        },
        'TriggeredAlarms': [
            {
                'Name': 'string',
                'State': 'UNKNOWN'|'ALARM'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      Information about the association.

      • Name (string) --

        The name of the SSM document.

      • InstanceId (string) --

        The managed node ID.

      • AssociationVersion (string) --

        The association version.

      • Date (datetime) --

        The date when the association was made.

      • LastUpdateAssociationDate (datetime) --

        The date when the association was last updated.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.

      • Overview (dict) --

        Information about the association.

        • Status (string) --

          The status of the association. Status can be: Pending, Success, or Failed.

        • DetailedStatus (string) --

          A detailed status of the association.

        • AssociationStatusAggregatedCount (dict) --

          Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.

          • (string) --

            • (integer) --

      • DocumentVersion (string) --

        The document version.

      • AutomationTargetParameterName (string) --

        Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

      • Parameters (dict) --

        A description of the parameters for a document.

        • (string) --

          • (list) --

            • (string) --

      • AssociationId (string) --

        The association ID.

      • Targets (list) --

        The managed nodes targeted by the request.

        • (dict) --

          An array of search criteria that targets managed nodes using a key-value pair that you specify.

          Note

          One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

          Supported formats include the following.

          • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

          • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

          • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

          • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

          For example:

          • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

          • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

          • Key=tag-key,Values=Name,Instance-Type,CostCenter

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

          • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

          • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

          For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

          • Key (string) --

            User-defined criteria for sending commands that target managed nodes that meet the criteria.

          • Values (list) --

            User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

            Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

            • (string) --

      • ScheduleExpression (string) --

        A cron expression that specifies a schedule when the association runs.

      • OutputLocation (dict) --

        An S3 bucket where you want to store the output details of the request.

        • S3Location (dict) --

          An S3 bucket where you want to store the results of this request.

          • OutputS3Region (string) --

            The Amazon Web Services Region of the S3 bucket.

          • OutputS3BucketName (string) --

            The name of the S3 bucket.

          • OutputS3KeyPrefix (string) --

            The S3 bucket subfolder.

      • LastExecutionDate (datetime) --

        The date on which the association was last run.

      • LastSuccessfulExecutionDate (datetime) --

        The last date on which the association was successfully run.

      • AssociationName (string) --

        The association name.

      • MaxErrors (string) --

        The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

        Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

      • MaxConcurrency (string) --

        The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

        If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

      • ComplianceSeverity (string) --

        The severity level that is assigned to the association.

      • SyncCompliance (string) --

        The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

        In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

        By default, all associations use AUTO mode.

      • ApplyOnlyAtCronInterval (boolean) --

        By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

      • CalendarNames (list) --

        The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

        • (string) --

      • TargetLocations (list) --

        The combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association.

        • (dict) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

          • Accounts (list) --

            The Amazon Web Services accounts targeted by the current Automation execution.

            • (string) --

          • Regions (list) --

            The Amazon Web Services Regions targeted by the current Automation execution.

            • (string) --

          • TargetLocationMaxConcurrency (string) --

            The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

          • TargetLocationMaxErrors (string) --

            The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

          • ExecutionRoleName (string) --

            The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

          • TargetLocationAlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

      • ScheduleOffset (integer) --

        Number of days to wait after the scheduled day to run an association.

      • TargetMaps (list) --

        A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

        • (dict) --

          • (string) --

            • (list) --

              • (string) --

      • AlarmConfiguration (dict) --

        The details for the CloudWatch alarm you want to apply to an automation or command.

        • IgnorePollAlarmFailure (boolean) --

          If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

        • Alarms (list) --

          The name of the CloudWatch alarm specified in the configuration.

          • (dict) --

            A CloudWatch alarm you apply to an automation or command.

            • Name (string) --

              The name of your CloudWatch alarm.

      • TriggeredAlarms (list) --

        The CloudWatch alarm that was invoked during the association.

        • (dict) --

          The details about the state of your CloudWatch alarm.

          • Name (string) --

            The name of your CloudWatch alarm.

          • State (string) --

            The state of your CloudWatch alarm.

DescribeAutomationExecutions (updated) Link ¶
Changes (response)
{'AutomationExecutionMetadataList': {'Runbooks': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                                           'IgnorePollAlarmFailure': 'boolean'}}}}}

Provides details about all active and terminated Automation executions.

See also: AWS API Documentation

Request Syntax

client.describe_automation_executions(
    Filters=[
        {
            'Key': 'DocumentNamePrefix'|'ExecutionStatus'|'ExecutionId'|'ParentExecutionId'|'CurrentAction'|'StartTimeBefore'|'StartTimeAfter'|'AutomationType'|'TagKey'|'TargetResourceGroup'|'AutomationSubtype'|'OpsItemId',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type Filters

list

param Filters

Filters used to limit the scope of executions that are requested.

  • (dict) --

    A filter used to match specific automation executions. This is used to limit the scope of Automation execution information returned.

    • Key (string) -- [REQUIRED]

      One or more keys to limit the results.

    • Values (list) -- [REQUIRED]

      The values used to limit the execution information associated with the filter's key.

      • (string) --

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

rtype

dict

returns

Response Syntax

{
    'AutomationExecutionMetadataList': [
        {
            'AutomationExecutionId': 'string',
            'DocumentName': 'string',
            'DocumentVersion': 'string',
            'AutomationExecutionStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure',
            'ExecutionStartTime': datetime(2015, 1, 1),
            'ExecutionEndTime': datetime(2015, 1, 1),
            'ExecutedBy': 'string',
            'LogFile': 'string',
            'Outputs': {
                'string': [
                    'string',
                ]
            },
            'Mode': 'Auto'|'Interactive',
            'ParentAutomationExecutionId': 'string',
            'CurrentStepName': 'string',
            'CurrentAction': 'string',
            'FailureMessage': 'string',
            'TargetParameterName': 'string',
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'TargetMaps': [
                {
                    'string': [
                        'string',
                    ]
                },
            ],
            'ResolvedTargets': {
                'ParameterValues': [
                    'string',
                ],
                'Truncated': True|False
            },
            'MaxConcurrency': 'string',
            'MaxErrors': 'string',
            'Target': 'string',
            'AutomationType': 'CrossAccount'|'Local',
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            },
            'TriggeredAlarms': [
                {
                    'Name': 'string',
                    'State': 'UNKNOWN'|'ALARM'
                },
            ],
            'AutomationSubtype': 'ChangeRequest',
            'ScheduledTime': datetime(2015, 1, 1),
            'Runbooks': [
                {
                    'DocumentName': 'string',
                    'DocumentVersion': 'string',
                    'Parameters': {
                        'string': [
                            'string',
                        ]
                    },
                    'TargetParameterName': 'string',
                    'Targets': [
                        {
                            'Key': 'string',
                            'Values': [
                                'string',
                            ]
                        },
                    ],
                    'TargetMaps': [
                        {
                            'string': [
                                'string',
                            ]
                        },
                    ],
                    'MaxConcurrency': 'string',
                    'MaxErrors': 'string',
                    'TargetLocations': [
                        {
                            'Accounts': [
                                'string',
                            ],
                            'Regions': [
                                'string',
                            ],
                            'TargetLocationMaxConcurrency': 'string',
                            'TargetLocationMaxErrors': 'string',
                            'ExecutionRoleName': 'string',
                            'TargetLocationAlarmConfiguration': {
                                'IgnorePollAlarmFailure': True|False,
                                'Alarms': [
                                    {
                                        'Name': 'string'
                                    },
                                ]
                            }
                        },
                    ]
                },
            ],
            'OpsItemId': 'string',
            'AssociationId': 'string',
            'ChangeRequestName': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AutomationExecutionMetadataList (list) --

      The list of details about each automation execution which has occurred which matches the filter specification, if any.

      • (dict) --

        Details about a specific Automation execution.

        • AutomationExecutionId (string) --

          The execution ID.

        • DocumentName (string) --

          The name of the Automation runbook used during execution.

        • DocumentVersion (string) --

          The document version used during the execution.

        • AutomationExecutionStatus (string) --

          The status of the execution.

        • ExecutionStartTime (datetime) --

          The time the execution started.

        • ExecutionEndTime (datetime) --

          The time the execution finished. This isn't populated if the execution is still in progress.

        • ExecutedBy (string) --

          The IAM role ARN of the user who ran the automation.

        • LogFile (string) --

          An S3 bucket where execution information is stored.

        • Outputs (dict) --

          The list of execution outputs as defined in the Automation runbook.

          • (string) --

            • (list) --

              • (string) --

        • Mode (string) --

          The Automation execution mode.

        • ParentAutomationExecutionId (string) --

          The execution ID of the parent automation.

        • CurrentStepName (string) --

          The name of the step that is currently running.

        • CurrentAction (string) --

          The action of the step that is currently running.

        • FailureMessage (string) --

          The list of execution outputs as defined in the Automation runbook.

        • TargetParameterName (string) --

          The list of execution outputs as defined in the Automation runbook.

        • Targets (list) --

          The targets defined by the user when starting the automation.

          • (dict) --

            An array of search criteria that targets managed nodes using a key-value pair that you specify.

            Note

            One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

            Supported formats include the following.

            • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

            • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

            • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

            • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

            For example:

            • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

            • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

            • Key=tag-key,Values=Name,Instance-Type,CostCenter

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

            • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

            • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

            For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

            • Key (string) --

              User-defined criteria for sending commands that target managed nodes that meet the criteria.

            • Values (list) --

              User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

              Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

              • (string) --

        • TargetMaps (list) --

          The specified key-value mapping of document parameters to target resources.

          • (dict) --

            • (string) --

              • (list) --

                • (string) --

        • ResolvedTargets (dict) --

          A list of targets that resolved during the execution.

          • ParameterValues (list) --

            A list of parameter values sent to targets that resolved during the Automation execution.

            • (string) --

          • Truncated (boolean) --

            A boolean value indicating whether the resolved target list is truncated.

        • MaxConcurrency (string) --

          The MaxConcurrency value specified by the user when starting the automation.

        • MaxErrors (string) --

          The MaxErrors value specified by the user when starting the automation.

        • Target (string) --

          The list of execution outputs as defined in the Automation runbook.

        • AutomationType (string) --

          Use this filter with DescribeAutomationExecutions. Specify either Local or CrossAccount. CrossAccount is an Automation that runs in multiple Amazon Web Services Regions and Amazon Web Services accounts. For more information, see Running Automation workflows in multiple Amazon Web Services Regions and accounts in the Amazon Web Services Systems Manager User Guide .

        • AlarmConfiguration (dict) --

          The details for the CloudWatch alarm applied to your automation.

          • IgnorePollAlarmFailure (boolean) --

            If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

          • Alarms (list) --

            The name of the CloudWatch alarm specified in the configuration.

            • (dict) --

              A CloudWatch alarm you apply to an automation or command.

              • Name (string) --

                The name of your CloudWatch alarm.

        • TriggeredAlarms (list) --

          The CloudWatch alarm that was invoked by the automation.

          • (dict) --

            The details about the state of your CloudWatch alarm.

            • Name (string) --

              The name of your CloudWatch alarm.

            • State (string) --

              The state of your CloudWatch alarm.

        • AutomationSubtype (string) --

          The subtype of the Automation operation. Currently, the only supported value is ChangeRequest .

        • ScheduledTime (datetime) --

          The date and time the Automation operation is scheduled to start.

        • Runbooks (list) --

          Information about the Automation runbooks that are run during a runbook workflow in Change Manager.

          Note

          The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

          • (dict) --

            Information about an Automation runbook used in a runbook workflow in Change Manager.

            Note

            The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

            • DocumentName (string) --

              The name of the Automation runbook used in a runbook workflow.

            • DocumentVersion (string) --

              The version of the Automation runbook used in a runbook workflow.

            • Parameters (dict) --

              The key-value map of execution parameters, which were supplied when calling StartChangeRequestExecution .

              • (string) --

                • (list) --

                  • (string) --

            • TargetParameterName (string) --

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

            • Targets (list) --

              A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify TargetParameterName .

              • (dict) --

                An array of search criteria that targets managed nodes using a key-value pair that you specify.

                Note

                One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

                Supported formats include the following.

                • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

                • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

                • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

                • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

                • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

                • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

                For example:

                • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

                • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

                • Key=tag-key,Values=Name,Instance-Type,CostCenter

                • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

                • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

                • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

                • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

                For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

                • Key (string) --

                  User-defined criteria for sending commands that target managed nodes that meet the criteria.

                • Values (list) --

                  User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

                  Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

                  • (string) --

            • TargetMaps (list) --

              A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.

              • (dict) --

                • (string) --

                  • (list) --

                    • (string) --

            • MaxConcurrency (string) --

              The MaxConcurrency value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.

            • MaxErrors (string) --

              The MaxErrors value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.

            • TargetLocations (list) --

              Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.

              • (dict) --

                The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

                • Accounts (list) --

                  The Amazon Web Services accounts targeted by the current Automation execution.

                  • (string) --

                • Regions (list) --

                  The Amazon Web Services Regions targeted by the current Automation execution.

                  • (string) --

                • TargetLocationMaxConcurrency (string) --

                  The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

                • TargetLocationMaxErrors (string) --

                  The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

                • ExecutionRoleName (string) --

                  The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

                • TargetLocationAlarmConfiguration (dict) --

                  The details for the CloudWatch alarm you want to apply to an automation or command.

                  • IgnorePollAlarmFailure (boolean) --

                    If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

                  • Alarms (list) --

                    The name of the CloudWatch alarm specified in the configuration.

                    • (dict) --

                      A CloudWatch alarm you apply to an automation or command.

                      • Name (string) --

                        The name of your CloudWatch alarm.

        • OpsItemId (string) --

          The ID of an OpsItem that is created to represent a Change Manager change request.

        • AssociationId (string) --

          The ID of a State Manager association used in the Automation operation.

        • ChangeRequestName (string) --

          The name of the Change Manager change request.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

DescribeAutomationStepExecutions (updated) Link ¶
Changes (response)
{'StepExecutions': {'TargetLocation': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                            'IgnorePollAlarmFailure': 'boolean'}},
                    'TriggeredAlarms': [{'Name': 'string',
                                         'State': 'UNKNOWN | ALARM'}]}}

Information about all active and terminated step executions in an Automation workflow.

See also: AWS API Documentation

Request Syntax

client.describe_automation_step_executions(
    AutomationExecutionId='string',
    Filters=[
        {
            'Key': 'StartTimeBefore'|'StartTimeAfter'|'StepExecutionStatus'|'StepExecutionId'|'StepName'|'Action',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxResults=123,
    ReverseOrder=True|False
)
type AutomationExecutionId

string

param AutomationExecutionId

[REQUIRED]

The Automation execution ID for which you want step execution descriptions.

type Filters

list

param Filters

One or more filters to limit the number of step executions returned by the request.

  • (dict) --

    A filter to limit the amount of step execution information returned by the call.

    • Key (string) -- [REQUIRED]

      One or more keys to limit the results. Valid filter keys include the following: StepName, Action, StepExecutionId, StepExecutionStatus, StartTimeBefore, StartTimeAfter.

    • Values (list) -- [REQUIRED]

      The values of the filter key.

      • (string) --

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type ReverseOrder

boolean

param ReverseOrder

Indicates whether to list step executions in reverse order by start time. The default value is 'false'.

rtype

dict

returns

Response Syntax

{
    'StepExecutions': [
        {
            'StepName': 'string',
            'Action': 'string',
            'TimeoutSeconds': 123,
            'OnFailure': 'string',
            'MaxAttempts': 123,
            'ExecutionStartTime': datetime(2015, 1, 1),
            'ExecutionEndTime': datetime(2015, 1, 1),
            'StepStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure',
            'ResponseCode': 'string',
            'Inputs': {
                'string': 'string'
            },
            'Outputs': {
                'string': [
                    'string',
                ]
            },
            'Response': 'string',
            'FailureMessage': 'string',
            'FailureDetails': {
                'FailureStage': 'string',
                'FailureType': 'string',
                'Details': {
                    'string': [
                        'string',
                    ]
                }
            },
            'StepExecutionId': 'string',
            'OverriddenParameters': {
                'string': [
                    'string',
                ]
            },
            'IsEnd': True|False,
            'NextStep': 'string',
            'IsCritical': True|False,
            'ValidNextSteps': [
                'string',
            ],
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'TargetLocation': {
                'Accounts': [
                    'string',
                ],
                'Regions': [
                    'string',
                ],
                'TargetLocationMaxConcurrency': 'string',
                'TargetLocationMaxErrors': 'string',
                'ExecutionRoleName': 'string',
                'TargetLocationAlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
            'TriggeredAlarms': [
                {
                    'Name': 'string',
                    'State': 'UNKNOWN'|'ALARM'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • StepExecutions (list) --

      A list of details about the current state of all steps that make up an execution.

      • (dict) --

        Detailed information about an the execution state of an Automation step.

        • StepName (string) --

          The name of this execution step.

        • Action (string) --

          The action this step performs. The action determines the behavior of the step.

        • TimeoutSeconds (integer) --

          The timeout seconds of the step.

        • OnFailure (string) --

          The action to take if the step fails. The default value is Abort .

        • MaxAttempts (integer) --

          The maximum number of tries to run the action of the step. The default value is 1 .

        • ExecutionStartTime (datetime) --

          If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field isn't populated.

        • ExecutionEndTime (datetime) --

          If a step has finished execution, this contains the time the execution ended. If the step hasn't yet concluded, this field isn't populated.

        • StepStatus (string) --

          The execution status for this step.

        • ResponseCode (string) --

          The response code returned by the execution of the step.

        • Inputs (dict) --

          Fully-resolved values passed into the step before execution.

          • (string) --

            • (string) --

        • Outputs (dict) --

          Returned values from the execution of the step.

          • (string) --

            • (list) --

              • (string) --

        • Response (string) --

          A message associated with the response code for an execution.

        • FailureMessage (string) --

          If a step failed, this message explains why the execution failed.

        • FailureDetails (dict) --

          Information about the Automation failure.

          • FailureStage (string) --

            The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.

          • FailureType (string) --

            The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.

          • Details (dict) --

            Detailed information about the Automation step failure.

            • (string) --

              • (list) --

                • (string) --

        • StepExecutionId (string) --

          The unique ID of a step execution.

        • OverriddenParameters (dict) --

          A user-specified list of parameters to override when running a step.

          • (string) --

            • (list) --

              • (string) --

        • IsEnd (boolean) --

          The flag which can be used to end automation no matter whether the step succeeds or fails.

        • NextStep (string) --

          The next step after the step succeeds.

        • IsCritical (boolean) --

          The flag which can be used to help decide whether the failure of current step leads to the Automation failure.

        • ValidNextSteps (list) --

          Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.

          • (string) --

        • Targets (list) --

          The targets for the step execution.

          • (dict) --

            An array of search criteria that targets managed nodes using a key-value pair that you specify.

            Note

            One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

            Supported formats include the following.

            • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

            • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

            • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

            • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

            For example:

            • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

            • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

            • Key=tag-key,Values=Name,Instance-Type,CostCenter

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

            • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

            • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

            For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

            • Key (string) --

              User-defined criteria for sending commands that target managed nodes that meet the criteria.

            • Values (list) --

              User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

              Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

              • (string) --

        • TargetLocation (dict) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

          • Accounts (list) --

            The Amazon Web Services accounts targeted by the current Automation execution.

            • (string) --

          • Regions (list) --

            The Amazon Web Services Regions targeted by the current Automation execution.

            • (string) --

          • TargetLocationMaxConcurrency (string) --

            The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

          • TargetLocationMaxErrors (string) --

            The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

          • ExecutionRoleName (string) --

            The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

          • TargetLocationAlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

        • TriggeredAlarms (list) --

          The CloudWatch alarms that were invoked by the automation.

          • (dict) --

            The details about the state of your CloudWatch alarm.

            • Name (string) --

              The name of your CloudWatch alarm.

            • State (string) --

              The state of your CloudWatch alarm.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

GetAutomationExecution (updated) Link ¶
Changes (response)
{'AutomationExecution': {'Runbooks': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                               'IgnorePollAlarmFailure': 'boolean'}}},
                         'StepExecutions': {'TargetLocation': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                                    'IgnorePollAlarmFailure': 'boolean'}},
                                            'TriggeredAlarms': [{'Name': 'string',
                                                                 'State': 'UNKNOWN '
                                                                          '| '
                                                                          'ALARM'}]},
                         'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                  'IgnorePollAlarmFailure': 'boolean'}}}}

Get detailed information about a particular Automation execution.

See also: AWS API Documentation

Request Syntax

client.get_automation_execution(
    AutomationExecutionId='string'
)
type AutomationExecutionId

string

param AutomationExecutionId

[REQUIRED]

The unique identifier for an existing automation execution to examine. The execution ID is returned by StartAutomationExecution when the execution of an Automation runbook is initiated.

rtype

dict

returns

Response Syntax

{
    'AutomationExecution': {
        'AutomationExecutionId': 'string',
        'DocumentName': 'string',
        'DocumentVersion': 'string',
        'ExecutionStartTime': datetime(2015, 1, 1),
        'ExecutionEndTime': datetime(2015, 1, 1),
        'AutomationExecutionStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure',
        'StepExecutions': [
            {
                'StepName': 'string',
                'Action': 'string',
                'TimeoutSeconds': 123,
                'OnFailure': 'string',
                'MaxAttempts': 123,
                'ExecutionStartTime': datetime(2015, 1, 1),
                'ExecutionEndTime': datetime(2015, 1, 1),
                'StepStatus': 'Pending'|'InProgress'|'Waiting'|'Success'|'TimedOut'|'Cancelling'|'Cancelled'|'Failed'|'PendingApproval'|'Approved'|'Rejected'|'Scheduled'|'RunbookInProgress'|'PendingChangeCalendarOverride'|'ChangeCalendarOverrideApproved'|'ChangeCalendarOverrideRejected'|'CompletedWithSuccess'|'CompletedWithFailure',
                'ResponseCode': 'string',
                'Inputs': {
                    'string': 'string'
                },
                'Outputs': {
                    'string': [
                        'string',
                    ]
                },
                'Response': 'string',
                'FailureMessage': 'string',
                'FailureDetails': {
                    'FailureStage': 'string',
                    'FailureType': 'string',
                    'Details': {
                        'string': [
                            'string',
                        ]
                    }
                },
                'StepExecutionId': 'string',
                'OverriddenParameters': {
                    'string': [
                        'string',
                    ]
                },
                'IsEnd': True|False,
                'NextStep': 'string',
                'IsCritical': True|False,
                'ValidNextSteps': [
                    'string',
                ],
                'Targets': [
                    {
                        'Key': 'string',
                        'Values': [
                            'string',
                        ]
                    },
                ],
                'TargetLocation': {
                    'Accounts': [
                        'string',
                    ],
                    'Regions': [
                        'string',
                    ],
                    'TargetLocationMaxConcurrency': 'string',
                    'TargetLocationMaxErrors': 'string',
                    'ExecutionRoleName': 'string',
                    'TargetLocationAlarmConfiguration': {
                        'IgnorePollAlarmFailure': True|False,
                        'Alarms': [
                            {
                                'Name': 'string'
                            },
                        ]
                    }
                },
                'TriggeredAlarms': [
                    {
                        'Name': 'string',
                        'State': 'UNKNOWN'|'ALARM'
                    },
                ]
            },
        ],
        'StepExecutionsTruncated': True|False,
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'Outputs': {
            'string': [
                'string',
            ]
        },
        'FailureMessage': 'string',
        'Mode': 'Auto'|'Interactive',
        'ParentAutomationExecutionId': 'string',
        'ExecutedBy': 'string',
        'CurrentStepName': 'string',
        'CurrentAction': 'string',
        'TargetParameterName': 'string',
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'TargetMaps': [
            {
                'string': [
                    'string',
                ]
            },
        ],
        'ResolvedTargets': {
            'ParameterValues': [
                'string',
            ],
            'Truncated': True|False
        },
        'MaxConcurrency': 'string',
        'MaxErrors': 'string',
        'Target': 'string',
        'TargetLocations': [
            {
                'Accounts': [
                    'string',
                ],
                'Regions': [
                    'string',
                ],
                'TargetLocationMaxConcurrency': 'string',
                'TargetLocationMaxErrors': 'string',
                'ExecutionRoleName': 'string',
                'TargetLocationAlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
        ],
        'ProgressCounters': {
            'TotalSteps': 123,
            'SuccessSteps': 123,
            'FailedSteps': 123,
            'CancelledSteps': 123,
            'TimedOutSteps': 123
        },
        'AlarmConfiguration': {
            'IgnorePollAlarmFailure': True|False,
            'Alarms': [
                {
                    'Name': 'string'
                },
            ]
        },
        'TriggeredAlarms': [
            {
                'Name': 'string',
                'State': 'UNKNOWN'|'ALARM'
            },
        ],
        'AutomationSubtype': 'ChangeRequest',
        'ScheduledTime': datetime(2015, 1, 1),
        'Runbooks': [
            {
                'DocumentName': 'string',
                'DocumentVersion': 'string',
                'Parameters': {
                    'string': [
                        'string',
                    ]
                },
                'TargetParameterName': 'string',
                'Targets': [
                    {
                        'Key': 'string',
                        'Values': [
                            'string',
                        ]
                    },
                ],
                'TargetMaps': [
                    {
                        'string': [
                            'string',
                        ]
                    },
                ],
                'MaxConcurrency': 'string',
                'MaxErrors': 'string',
                'TargetLocations': [
                    {
                        'Accounts': [
                            'string',
                        ],
                        'Regions': [
                            'string',
                        ],
                        'TargetLocationMaxConcurrency': 'string',
                        'TargetLocationMaxErrors': 'string',
                        'ExecutionRoleName': 'string',
                        'TargetLocationAlarmConfiguration': {
                            'IgnorePollAlarmFailure': True|False,
                            'Alarms': [
                                {
                                    'Name': 'string'
                                },
                            ]
                        }
                    },
                ]
            },
        ],
        'OpsItemId': 'string',
        'AssociationId': 'string',
        'ChangeRequestName': 'string'
    }
}

Response Structure

  • (dict) --

    • AutomationExecution (dict) --

      Detailed information about the current state of an automation execution.

      • AutomationExecutionId (string) --

        The execution ID.

      • DocumentName (string) --

        The name of the Automation runbook used during the execution.

      • DocumentVersion (string) --

        The version of the document to use during execution.

      • ExecutionStartTime (datetime) --

        The time the execution started.

      • ExecutionEndTime (datetime) --

        The time the execution finished.

      • AutomationExecutionStatus (string) --

        The execution status of the Automation.

      • StepExecutions (list) --

        A list of details about the current state of all steps that comprise an execution. An Automation runbook contains a list of steps that are run in order.

        • (dict) --

          Detailed information about an the execution state of an Automation step.

          • StepName (string) --

            The name of this execution step.

          • Action (string) --

            The action this step performs. The action determines the behavior of the step.

          • TimeoutSeconds (integer) --

            The timeout seconds of the step.

          • OnFailure (string) --

            The action to take if the step fails. The default value is Abort .

          • MaxAttempts (integer) --

            The maximum number of tries to run the action of the step. The default value is 1 .

          • ExecutionStartTime (datetime) --

            If a step has begun execution, this contains the time the step started. If the step is in Pending status, this field isn't populated.

          • ExecutionEndTime (datetime) --

            If a step has finished execution, this contains the time the execution ended. If the step hasn't yet concluded, this field isn't populated.

          • StepStatus (string) --

            The execution status for this step.

          • ResponseCode (string) --

            The response code returned by the execution of the step.

          • Inputs (dict) --

            Fully-resolved values passed into the step before execution.

            • (string) --

              • (string) --

          • Outputs (dict) --

            Returned values from the execution of the step.

            • (string) --

              • (list) --

                • (string) --

          • Response (string) --

            A message associated with the response code for an execution.

          • FailureMessage (string) --

            If a step failed, this message explains why the execution failed.

          • FailureDetails (dict) --

            Information about the Automation failure.

            • FailureStage (string) --

              The stage of the Automation execution when the failure occurred. The stages include the following: InputValidation, PreVerification, Invocation, PostVerification.

            • FailureType (string) --

              The type of Automation failure. Failure types include the following: Action, Permission, Throttling, Verification, Internal.

            • Details (dict) --

              Detailed information about the Automation step failure.

              • (string) --

                • (list) --

                  • (string) --

          • StepExecutionId (string) --

            The unique ID of a step execution.

          • OverriddenParameters (dict) --

            A user-specified list of parameters to override when running a step.

            • (string) --

              • (list) --

                • (string) --

          • IsEnd (boolean) --

            The flag which can be used to end automation no matter whether the step succeeds or fails.

          • NextStep (string) --

            The next step after the step succeeds.

          • IsCritical (boolean) --

            The flag which can be used to help decide whether the failure of current step leads to the Automation failure.

          • ValidNextSteps (list) --

            Strategies used when step fails, we support Continue and Abort. Abort will fail the automation when the step fails. Continue will ignore the failure of current step and allow automation to run the next step. With conditional branching, we add step:stepName to support the automation to go to another specific step.

            • (string) --

          • Targets (list) --

            The targets for the step execution.

            • (dict) --

              An array of search criteria that targets managed nodes using a key-value pair that you specify.

              Note

              One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

              Supported formats include the following.

              • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

              • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

              • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

              • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

              • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

              • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

              For example:

              • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

              • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

              • Key=tag-key,Values=Name,Instance-Type,CostCenter

              • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

              • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

              • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

              • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

              For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

              • Key (string) --

                User-defined criteria for sending commands that target managed nodes that meet the criteria.

              • Values (list) --

                User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

                Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

                • (string) --

          • TargetLocation (dict) --

            The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

            • Accounts (list) --

              The Amazon Web Services accounts targeted by the current Automation execution.

              • (string) --

            • Regions (list) --

              The Amazon Web Services Regions targeted by the current Automation execution.

              • (string) --

            • TargetLocationMaxConcurrency (string) --

              The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

            • TargetLocationMaxErrors (string) --

              The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

            • ExecutionRoleName (string) --

              The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

            • TargetLocationAlarmConfiguration (dict) --

              The details for the CloudWatch alarm you want to apply to an automation or command.

              • IgnorePollAlarmFailure (boolean) --

                If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

              • Alarms (list) --

                The name of the CloudWatch alarm specified in the configuration.

                • (dict) --

                  A CloudWatch alarm you apply to an automation or command.

                  • Name (string) --

                    The name of your CloudWatch alarm.

          • TriggeredAlarms (list) --

            The CloudWatch alarms that were invoked by the automation.

            • (dict) --

              The details about the state of your CloudWatch alarm.

              • Name (string) --

                The name of your CloudWatch alarm.

              • State (string) --

                The state of your CloudWatch alarm.

      • StepExecutionsTruncated (boolean) --

        A boolean value that indicates if the response contains the full list of the Automation step executions. If true, use the DescribeAutomationStepExecutions API operation to get the full list of step executions.

      • Parameters (dict) --

        The key-value map of execution parameters, which were supplied when calling StartAutomationExecution.

        • (string) --

          • (list) --

            • (string) --

      • Outputs (dict) --

        The list of execution outputs as defined in the Automation runbook.

        • (string) --

          • (list) --

            • (string) --

      • FailureMessage (string) --

        A message describing why an execution has failed, if the status is set to Failed.

      • Mode (string) --

        The automation execution mode.

      • ParentAutomationExecutionId (string) --

        The AutomationExecutionId of the parent automation.

      • ExecutedBy (string) --

        The Amazon Resource Name (ARN) of the user who ran the automation.

      • CurrentStepName (string) --

        The name of the step that is currently running.

      • CurrentAction (string) --

        The action of the step that is currently running.

      • TargetParameterName (string) --

        The parameter name.

      • Targets (list) --

        The specified targets.

        • (dict) --

          An array of search criteria that targets managed nodes using a key-value pair that you specify.

          Note

          One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

          Supported formats include the following.

          • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

          • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

          • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

          • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

          For example:

          • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

          • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

          • Key=tag-key,Values=Name,Instance-Type,CostCenter

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

          • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

          • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

          For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

          • Key (string) --

            User-defined criteria for sending commands that target managed nodes that meet the criteria.

          • Values (list) --

            User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

            Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

            • (string) --

      • TargetMaps (list) --

        The specified key-value mapping of document parameters to target resources.

        • (dict) --

          • (string) --

            • (list) --

              • (string) --

      • ResolvedTargets (dict) --

        A list of resolved targets in the rate control execution.

        • ParameterValues (list) --

          A list of parameter values sent to targets that resolved during the Automation execution.

          • (string) --

        • Truncated (boolean) --

          A boolean value indicating whether the resolved target list is truncated.

      • MaxConcurrency (string) --

        The MaxConcurrency value specified by the user when the execution started.

      • MaxErrors (string) --

        The MaxErrors value specified by the user when the execution started.

      • Target (string) --

        The target of the execution.

      • TargetLocations (list) --

        The combination of Amazon Web Services Regions and/or Amazon Web Services accounts where you want to run the Automation.

        • (dict) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

          • Accounts (list) --

            The Amazon Web Services accounts targeted by the current Automation execution.

            • (string) --

          • Regions (list) --

            The Amazon Web Services Regions targeted by the current Automation execution.

            • (string) --

          • TargetLocationMaxConcurrency (string) --

            The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

          • TargetLocationMaxErrors (string) --

            The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

          • ExecutionRoleName (string) --

            The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

          • TargetLocationAlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

      • ProgressCounters (dict) --

        An aggregate of step execution statuses displayed in the Amazon Web Services Systems Manager console for a multi-Region and multi-account Automation execution.

        • TotalSteps (integer) --

          The total number of steps run in all specified Amazon Web Services Regions and Amazon Web Services accounts for the current Automation execution.

        • SuccessSteps (integer) --

          The total number of steps that successfully completed in all specified Amazon Web Services Regions and Amazon Web Services accounts for the current Automation execution.

        • FailedSteps (integer) --

          The total number of steps that failed to run in all specified Amazon Web Services Regions and Amazon Web Services accounts for the current Automation execution.

        • CancelledSteps (integer) --

          The total number of steps that the system cancelled in all specified Amazon Web Services Regions and Amazon Web Services accounts for the current Automation execution.

        • TimedOutSteps (integer) --

          The total number of steps that timed out in all specified Amazon Web Services Regions and Amazon Web Services accounts for the current Automation execution.

      • AlarmConfiguration (dict) --

        The details for the CloudWatch alarm applied to your automation.

        • IgnorePollAlarmFailure (boolean) --

          If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

        • Alarms (list) --

          The name of the CloudWatch alarm specified in the configuration.

          • (dict) --

            A CloudWatch alarm you apply to an automation or command.

            • Name (string) --

              The name of your CloudWatch alarm.

      • TriggeredAlarms (list) --

        The CloudWatch alarm that was invoked by the automation.

        • (dict) --

          The details about the state of your CloudWatch alarm.

          • Name (string) --

            The name of your CloudWatch alarm.

          • State (string) --

            The state of your CloudWatch alarm.

      • AutomationSubtype (string) --

        The subtype of the Automation operation. Currently, the only supported value is ChangeRequest .

      • ScheduledTime (datetime) --

        The date and time the Automation operation is scheduled to start.

      • Runbooks (list) --

        Information about the Automation runbooks that are run as part of a runbook workflow.

        Note

        The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

        • (dict) --

          Information about an Automation runbook used in a runbook workflow in Change Manager.

          Note

          The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

          • DocumentName (string) --

            The name of the Automation runbook used in a runbook workflow.

          • DocumentVersion (string) --

            The version of the Automation runbook used in a runbook workflow.

          • Parameters (dict) --

            The key-value map of execution parameters, which were supplied when calling StartChangeRequestExecution .

            • (string) --

              • (list) --

                • (string) --

          • TargetParameterName (string) --

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

          • Targets (list) --

            A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify TargetParameterName .

            • (dict) --

              An array of search criteria that targets managed nodes using a key-value pair that you specify.

              Note

              One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

              Supported formats include the following.

              • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

              • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

              • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

              • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

              • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

              • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

              For example:

              • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

              • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

              • Key=tag-key,Values=Name,Instance-Type,CostCenter

              • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

              • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

              • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

              • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

              For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

              • Key (string) --

                User-defined criteria for sending commands that target managed nodes that meet the criteria.

              • Values (list) --

                User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

                Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

                • (string) --

          • TargetMaps (list) --

            A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.

            • (dict) --

              • (string) --

                • (list) --

                  • (string) --

          • MaxConcurrency (string) --

            The MaxConcurrency value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.

          • MaxErrors (string) --

            The MaxErrors value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.

          • TargetLocations (list) --

            Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.

            • (dict) --

              The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

              • Accounts (list) --

                The Amazon Web Services accounts targeted by the current Automation execution.

                • (string) --

              • Regions (list) --

                The Amazon Web Services Regions targeted by the current Automation execution.

                • (string) --

              • TargetLocationMaxConcurrency (string) --

                The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

              • TargetLocationMaxErrors (string) --

                The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

              • ExecutionRoleName (string) --

                The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

              • TargetLocationAlarmConfiguration (dict) --

                The details for the CloudWatch alarm you want to apply to an automation or command.

                • IgnorePollAlarmFailure (boolean) --

                  If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

                • Alarms (list) --

                  The name of the CloudWatch alarm specified in the configuration.

                  • (dict) --

                    A CloudWatch alarm you apply to an automation or command.

                    • Name (string) --

                      The name of your CloudWatch alarm.

      • OpsItemId (string) --

        The ID of an OpsItem that is created to represent a Change Manager change request.

      • AssociationId (string) --

        The ID of a State Manager association used in the Automation operation.

      • ChangeRequestName (string) --

        The name of the Change Manager change request.

ListAssociationVersions (updated) Link ¶
Changes (response)
{'AssociationVersions': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                  'IgnorePollAlarmFailure': 'boolean'}}}}

Retrieves all versions of an association for a specific association ID.

See also: AWS API Documentation

Request Syntax

client.list_association_versions(
    AssociationId='string',
    MaxResults=123,
    NextToken='string'
)
type AssociationId

string

param AssociationId

[REQUIRED]

The association ID for which you want to view all versions.

type MaxResults

integer

param MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

type NextToken

string

param NextToken

A token to start the list. Use this token to get the next set of results.

rtype

dict

returns

Response Syntax

{
    'AssociationVersions': [
        {
            'AssociationId': 'string',
            'AssociationVersion': 'string',
            'CreatedDate': datetime(2015, 1, 1),
            'Name': 'string',
            'DocumentVersion': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'ScheduleExpression': 'string',
            'OutputLocation': {
                'S3Location': {
                    'OutputS3Region': 'string',
                    'OutputS3BucketName': 'string',
                    'OutputS3KeyPrefix': 'string'
                }
            },
            'AssociationName': 'string',
            'MaxErrors': 'string',
            'MaxConcurrency': 'string',
            'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
            'SyncCompliance': 'AUTO'|'MANUAL',
            'ApplyOnlyAtCronInterval': True|False,
            'CalendarNames': [
                'string',
            ],
            'TargetLocations': [
                {
                    'Accounts': [
                        'string',
                    ],
                    'Regions': [
                        'string',
                    ],
                    'TargetLocationMaxConcurrency': 'string',
                    'TargetLocationMaxErrors': 'string',
                    'ExecutionRoleName': 'string',
                    'TargetLocationAlarmConfiguration': {
                        'IgnorePollAlarmFailure': True|False,
                        'Alarms': [
                            {
                                'Name': 'string'
                            },
                        ]
                    }
                },
            ],
            'ScheduleOffset': 123,
            'TargetMaps': [
                {
                    'string': [
                        'string',
                    ]
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AssociationVersions (list) --

      Information about all versions of the association for the specified association ID.

      • (dict) --

        Information about the association version.

        • AssociationId (string) --

          The ID created by the system when the association was created.

        • AssociationVersion (string) --

          The association version.

        • CreatedDate (datetime) --

          The date the association version was created.

        • Name (string) --

          The name specified when the association was created.

        • DocumentVersion (string) --

          The version of an Amazon Web Services Systems Manager document (SSM document) used when the association version was created.

        • Parameters (dict) --

          Parameters specified when the association version was created.

          • (string) --

            • (list) --

              • (string) --

        • Targets (list) --

          The targets specified for the association when the association version was created.

          • (dict) --

            An array of search criteria that targets managed nodes using a key-value pair that you specify.

            Note

            One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

            Supported formats include the following.

            • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

            • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

            • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

            • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

            For example:

            • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

            • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

            • Key=tag-key,Values=Name,Instance-Type,CostCenter

            • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

            • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

            • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

            • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

            For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

            • Key (string) --

              User-defined criteria for sending commands that target managed nodes that meet the criteria.

            • Values (list) --

              User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

              Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

              • (string) --

        • ScheduleExpression (string) --

          The cron or rate schedule specified for the association when the association version was created.

        • OutputLocation (dict) --

          The location in Amazon S3 specified for the association when the association version was created.

          • S3Location (dict) --

            An S3 bucket where you want to store the results of this request.

            • OutputS3Region (string) --

              The Amazon Web Services Region of the S3 bucket.

            • OutputS3BucketName (string) --

              The name of the S3 bucket.

            • OutputS3KeyPrefix (string) --

              The S3 bucket subfolder.

        • AssociationName (string) --

          The name specified for the association version when the association version was created.

        • MaxErrors (string) --

          The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

          Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

        • MaxConcurrency (string) --

          The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

          If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

        • ComplianceSeverity (string) --

          The severity level that is assigned to the association.

        • SyncCompliance (string) --

          The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

          In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

          By default, all associations use AUTO mode.

        • ApplyOnlyAtCronInterval (boolean) --

          By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

        • CalendarNames (list) --

          The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations for this version only run when that Change Calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

          • (string) --

        • TargetLocations (list) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts where you wanted to run the association when this association version was created.

          • (dict) --

            The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

            • Accounts (list) --

              The Amazon Web Services accounts targeted by the current Automation execution.

              • (string) --

            • Regions (list) --

              The Amazon Web Services Regions targeted by the current Automation execution.

              • (string) --

            • TargetLocationMaxConcurrency (string) --

              The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

            • TargetLocationMaxErrors (string) --

              The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

            • ExecutionRoleName (string) --

              The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

            • TargetLocationAlarmConfiguration (dict) --

              The details for the CloudWatch alarm you want to apply to an automation or command.

              • IgnorePollAlarmFailure (boolean) --

                If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

              • Alarms (list) --

                The name of the CloudWatch alarm specified in the configuration.

                • (dict) --

                  A CloudWatch alarm you apply to an automation or command.

                  • Name (string) --

                    The name of your CloudWatch alarm.

        • ScheduleOffset (integer) --

          Number of days to wait after the scheduled day to run an association.

        • TargetMaps (list) --

          A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

          • (dict) --

            • (string) --

              • (list) --

                • (string) --

    • NextToken (string) --

      The token for the next set of items to return. Use this token to get the next set of results.

StartAutomationExecution (updated) Link ¶
Changes (request)
{'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                          'IgnorePollAlarmFailure': 'boolean'}}}

Initiates execution of an Automation runbook.

See also: AWS API Documentation

Request Syntax

client.start_automation_execution(
    DocumentName='string',
    DocumentVersion='string',
    Parameters={
        'string': [
            'string',
        ]
    },
    ClientToken='string',
    Mode='Auto'|'Interactive',
    TargetParameterName='string',
    Targets=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    TargetMaps=[
        {
            'string': [
                'string',
            ]
        },
    ],
    MaxConcurrency='string',
    MaxErrors='string',
    TargetLocations=[
        {
            'Accounts': [
                'string',
            ],
            'Regions': [
                'string',
            ],
            'TargetLocationMaxConcurrency': 'string',
            'TargetLocationMaxErrors': 'string',
            'ExecutionRoleName': 'string',
            'TargetLocationAlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            }
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    AlarmConfiguration={
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
)
type DocumentName

string

param DocumentName

[REQUIRED]

The name of the SSM document to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document ARN. For more information about how to use shared documents, see Using shared SSM documents in the Amazon Web Services Systems Manager User Guide .

type DocumentVersion

string

param DocumentVersion

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

type Parameters

dict

param Parameters

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

  • (string) --

    • (list) --

      • (string) --

type ClientToken

string

param ClientToken

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

type Mode

string

param Mode

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

type TargetParameterName

string

param TargetParameterName

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

type Targets

list

param Targets

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

  • (dict) --

    An array of search criteria that targets managed nodes using a key-value pair that you specify.

    Note

    One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

    Supported formats include the following.

    • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

    • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

    • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

    • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

    • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

    • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

    For example:

    • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

    • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

    • Key=tag-key,Values=Name,Instance-Type,CostCenter

    • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

    • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

    • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

    • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

    For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

    • Key (string) --

      User-defined criteria for sending commands that target managed nodes that meet the criteria.

    • Values (list) --

      User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

      Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

      • (string) --

type TargetMaps

list

param TargetMaps

A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

  • (dict) --

    • (string) --

      • (list) --

        • (string) --

type MaxConcurrency

string

param 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 MaxErrors

string

param 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 TargetLocations

list

param TargetLocations

A location is a combination of Amazon Web Services Regions and/or Amazon Web Services accounts where you want to run the automation. Use this operation to start an automation in multiple Amazon Web Services Regions and multiple Amazon Web Services accounts. For more information, see Running Automation workflows in multiple Amazon Web Services Regions and Amazon Web Services accounts in the Amazon Web Services Systems Manager User Guide .

  • (dict) --

    The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

    • Accounts (list) --

      The Amazon Web Services accounts targeted by the current Automation execution.

      • (string) --

    • Regions (list) --

      The Amazon Web Services Regions targeted by the current Automation execution.

      • (string) --

    • TargetLocationMaxConcurrency (string) --

      The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

    • TargetLocationMaxErrors (string) --

      The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

    • ExecutionRoleName (string) --

      The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

    • TargetLocationAlarmConfiguration (dict) --

      The details for the CloudWatch alarm you want to apply to an automation or command.

      • IgnorePollAlarmFailure (boolean) --

        If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

      • Alarms (list) -- [REQUIRED]

        The name of the CloudWatch alarm specified in the configuration.

        • (dict) --

          A CloudWatch alarm you apply to an automation or command.

          • Name (string) -- [REQUIRED]

            The name of your CloudWatch alarm.

type Tags

list

param Tags

Optional metadata that you assign to a resource. You can specify a maximum of five tags for an automation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an automation to identify an environment or operating system. In this case, you could specify the following key-value pairs:

  • Key=environment,Value=test

  • Key=OS,Value=Windows

Note

To add tags to an existing automation, use the AddTagsToResource operation.

  • (dict) --

    Metadata that you assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Amazon Web Services Systems Manager, you can apply tags to Systems Manager documents (SSM documents), managed nodes, maintenance windows, parameters, patch baselines, OpsItems, and OpsMetadata.

    • Key (string) -- [REQUIRED]

      The name of the tag.

    • Value (string) -- [REQUIRED]

      The value of the tag.

type AlarmConfiguration

dict

param AlarmConfiguration

The CloudWatch alarm you want to apply to your automation.

  • IgnorePollAlarmFailure (boolean) --

    If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

  • Alarms (list) -- [REQUIRED]

    The name of the CloudWatch alarm specified in the configuration.

    • (dict) --

      A CloudWatch alarm you apply to an automation or command.

      • Name (string) -- [REQUIRED]

        The name of your CloudWatch alarm.

rtype

dict

returns

Response Syntax

{
    'AutomationExecutionId': 'string'
}

Response Structure

  • (dict) --

    • AutomationExecutionId (string) --

      The unique ID of a newly scheduled automation execution.

StartChangeRequestExecution (updated) Link ¶
Changes (request)
{'Runbooks': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                       'IgnorePollAlarmFailure': 'boolean'}}}}

Creates a change request for Change Manager. The Automation runbooks specified in the change request run only after all required approvals for the change request have been received.

See also: AWS API Documentation

Request Syntax

client.start_change_request_execution(
    ScheduledTime=datetime(2015, 1, 1),
    DocumentName='string',
    DocumentVersion='string',
    Parameters={
        'string': [
            'string',
        ]
    },
    ChangeRequestName='string',
    ClientToken='string',
    AutoApprove=True|False,
    Runbooks=[
        {
            'DocumentName': 'string',
            'DocumentVersion': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'TargetParameterName': 'string',
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'TargetMaps': [
                {
                    'string': [
                        'string',
                    ]
                },
            ],
            'MaxConcurrency': 'string',
            'MaxErrors': 'string',
            'TargetLocations': [
                {
                    'Accounts': [
                        'string',
                    ],
                    'Regions': [
                        'string',
                    ],
                    'TargetLocationMaxConcurrency': 'string',
                    'TargetLocationMaxErrors': 'string',
                    'ExecutionRoleName': 'string',
                    'TargetLocationAlarmConfiguration': {
                        'IgnorePollAlarmFailure': True|False,
                        'Alarms': [
                            {
                                'Name': 'string'
                            },
                        ]
                    }
                },
            ]
        },
    ],
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ScheduledEndTime=datetime(2015, 1, 1),
    ChangeDetails='string'
)
type ScheduledTime

datetime

param ScheduledTime

The date and time specified in the change request to run the Automation runbooks.

Note

The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

type DocumentName

string

param DocumentName

[REQUIRED]

The name of the change template document to run during the runbook workflow.

type DocumentVersion

string

param DocumentVersion

The version of the change template document to run during the runbook workflow.

type Parameters

dict

param Parameters

A key-value map of parameters that match the declared parameters in the change template document.

  • (string) --

    • (list) --

      • (string) --

type ChangeRequestName

string

param ChangeRequestName

The name of the change request associated with the runbook workflow to be run.

type ClientToken

string

param ClientToken

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

type AutoApprove

boolean

param AutoApprove

Indicates whether the change request can be approved automatically without the need for manual approvals.

If AutoApprovable is enabled in a change template, then setting AutoApprove to true in StartChangeRequestExecution creates a change request that bypasses approver review.

Note

Change Calendar restrictions are not bypassed in this scenario. If the state of an associated calendar is CLOSED , change freeze approvers must still grant permission for this change request to run. If they don't, the change won't be processed until the calendar state is again OPEN .

type Runbooks

list

param Runbooks

[REQUIRED]

Information about the Automation runbooks that are run during the runbook workflow.

Note

The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

  • (dict) --

    Information about an Automation runbook used in a runbook workflow in Change Manager.

    Note

    The Automation runbooks specified for the runbook workflow can't run until all required approvals for the change request have been received.

    • DocumentName (string) -- [REQUIRED]

      The name of the Automation runbook used in a runbook workflow.

    • DocumentVersion (string) --

      The version of the Automation runbook used in a runbook workflow.

    • Parameters (dict) --

      The key-value map of execution parameters, which were supplied when calling StartChangeRequestExecution .

      • (string) --

        • (list) --

          • (string) --

    • TargetParameterName (string) --

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

    • Targets (list) --

      A key-value mapping to target resources that the runbook operation performs tasks on. Required if you specify TargetParameterName .

      • (dict) --

        An array of search criteria that targets managed nodes using a key-value pair that you specify.

        Note

        One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

        Supported formats include the following.

        • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

        • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

        • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

        • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

        • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

        • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

        For example:

        • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

        • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

        • Key=tag-key,Values=Name,Instance-Type,CostCenter

        • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

        • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

        • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

        • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

        For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

        • Key (string) --

          User-defined criteria for sending commands that target managed nodes that meet the criteria.

        • Values (list) --

          User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

          Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

          • (string) --

    • TargetMaps (list) --

      A key-value mapping of runbook parameters to target resources. Both Targets and TargetMaps can't be specified together.

      • (dict) --

        • (string) --

          • (list) --

            • (string) --

    • MaxConcurrency (string) --

      The MaxConcurrency value specified by the user when the operation started, indicating the maximum number of resources that the runbook operation can run on at the same time.

    • MaxErrors (string) --

      The MaxErrors value specified by the user when the execution started, indicating the maximum number of errors that can occur during the operation before the updates are stopped or rolled back.

    • TargetLocations (list) --

      Information about the Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Runbook operation.

      • (dict) --

        The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

        • Accounts (list) --

          The Amazon Web Services accounts targeted by the current Automation execution.

          • (string) --

        • Regions (list) --

          The Amazon Web Services Regions targeted by the current Automation execution.

          • (string) --

        • TargetLocationMaxConcurrency (string) --

          The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

        • TargetLocationMaxErrors (string) --

          The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

        • ExecutionRoleName (string) --

          The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

        • TargetLocationAlarmConfiguration (dict) --

          The details for the CloudWatch alarm you want to apply to an automation or command.

          • IgnorePollAlarmFailure (boolean) --

            If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

          • Alarms (list) -- [REQUIRED]

            The name of the CloudWatch alarm specified in the configuration.

            • (dict) --

              A CloudWatch alarm you apply to an automation or command.

              • Name (string) -- [REQUIRED]

                The name of your CloudWatch alarm.

type Tags

list

param Tags

Optional metadata that you assign to a resource. You can specify a maximum of five tags for a change request. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a change request to identify an environment or target Amazon Web Services Region. In this case, you could specify the following key-value pairs:

  • Key=Environment,Value=Production

  • Key=Region,Value=us-east-2

  • (dict) --

    Metadata that you assign to your Amazon Web Services resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Amazon Web Services Systems Manager, you can apply tags to Systems Manager documents (SSM documents), managed nodes, maintenance windows, parameters, patch baselines, OpsItems, and OpsMetadata.

    • Key (string) -- [REQUIRED]

      The name of the tag.

    • Value (string) -- [REQUIRED]

      The value of the tag.

type ScheduledEndTime

datetime

param ScheduledEndTime

The time that the requester expects the runbook workflow related to the change request to complete. The time is an estimate only that the requester provides for reviewers.

type ChangeDetails

string

param ChangeDetails

User-provided details about the change. If no details are provided, content specified in the Template information section of the associated change template is added.

rtype

dict

returns

Response Syntax

{
    'AutomationExecutionId': 'string'
}

Response Structure

  • (dict) --

    • AutomationExecutionId (string) --

      The unique ID of a runbook workflow operation. (A runbook workflow is a type of Automation operation.)

UpdateAssociation (updated) Link ¶
Changes (request, response)
Request
{'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                          'IgnorePollAlarmFailure': 'boolean'}}}
Response
{'AssociationDescription': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                     'IgnorePollAlarmFailure': 'boolean'}}}}

Updates an association. You can update the association name and version, the document version, schedule, parameters, and Amazon Simple Storage Service (Amazon S3) output. When you call UpdateAssociation , the system removes all optional parameters from the request and overwrites the association with null values for those parameters. This is by design. You must specify all optional parameters in the call, even if you are not changing the parameters. This includes the Name parameter. Before calling this API action, we recommend that you call the DescribeAssociation API operation and make a note of all optional parameters required for your UpdateAssociation call.

In order to call this API operation, your Identity and Access Management (IAM) user account, group, or role must be configured with permission to call the DescribeAssociation API operation. If you don't have permission to call DescribeAssociation , then you receive the following error: An error occurred (AccessDeniedException) when calling the UpdateAssociation operation: User: <user_arn> isn't authorized to perform: ssm:DescribeAssociation on resource: <resource_arn>

Warning

When you update an association, the association immediately runs against the specified targets. You can add the ApplyOnlyAtCronInterval parameter to run the association during the next schedule run.

See also: AWS API Documentation

Request Syntax

client.update_association(
    AssociationId='string',
    Parameters={
        'string': [
            'string',
        ]
    },
    DocumentVersion='string',
    ScheduleExpression='string',
    OutputLocation={
        'S3Location': {
            'OutputS3Region': 'string',
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string'
        }
    },
    Name='string',
    Targets=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    AssociationName='string',
    AssociationVersion='string',
    AutomationTargetParameterName='string',
    MaxErrors='string',
    MaxConcurrency='string',
    ComplianceSeverity='CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
    SyncCompliance='AUTO'|'MANUAL',
    ApplyOnlyAtCronInterval=True|False,
    CalendarNames=[
        'string',
    ],
    TargetLocations=[
        {
            'Accounts': [
                'string',
            ],
            'Regions': [
                'string',
            ],
            'TargetLocationMaxConcurrency': 'string',
            'TargetLocationMaxErrors': 'string',
            'ExecutionRoleName': 'string',
            'TargetLocationAlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            }
        },
    ],
    ScheduleOffset=123,
    TargetMaps=[
        {
            'string': [
                'string',
            ]
        },
    ],
    AlarmConfiguration={
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
)
type AssociationId

string

param AssociationId

[REQUIRED]

The ID of the association you want to update.

type Parameters

dict

param Parameters

The parameters you want to update for the association. If you create a parameter using Parameter Store, a capability of Amazon Web Services Systems Manager, you can reference the parameter using {{ssm:parameter-name}} .

  • (string) --

    • (list) --

      • (string) --

type DocumentVersion

string

param DocumentVersion

The document version you want update for the association.

Warning

State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the default version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to default .

type ScheduleExpression

string

param ScheduleExpression

The cron expression used to schedule the association that you want to update.

type OutputLocation

dict

param OutputLocation

An S3 bucket where you want to store the results of this request.

  • S3Location (dict) --

    An S3 bucket where you want to store the results of this request.

    • OutputS3Region (string) --

      The Amazon Web Services Region of the S3 bucket.

    • OutputS3BucketName (string) --

      The name of the S3 bucket.

    • OutputS3KeyPrefix (string) --

      The S3 bucket subfolder.

type Name

string

param Name

The name of the SSM Command document or Automation runbook that contains the configuration information for the managed node.

You can specify Amazon Web Services-predefined documents, documents you created, or a document that is shared with you from another account.

For Systems Manager document (SSM document) that are shared with you from other Amazon Web Services accounts, you must specify the complete SSM document ARN, in the following format:

arn:aws:ssm:region:account-id:document/document-name

For example:

arn:aws:ssm:us-east-2:12345678912:document/My-Shared-Document

For Amazon Web Services-predefined documents and SSM documents you created in your account, you only need to specify the document name. For example, AWS-ApplyPatchBaseline or My-Document .

type Targets

list

param Targets

The targets of the association.

  • (dict) --

    An array of search criteria that targets managed nodes using a key-value pair that you specify.

    Note

    One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

    Supported formats include the following.

    • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

    • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

    • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

    • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

    • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

    • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

    For example:

    • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

    • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

    • Key=tag-key,Values=Name,Instance-Type,CostCenter

    • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

    • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

    • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

    • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

    For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

    • Key (string) --

      User-defined criteria for sending commands that target managed nodes that meet the criteria.

    • Values (list) --

      User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

      Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

      • (string) --

type AssociationName

string

param AssociationName

The name of the association that you want to update.

type AssociationVersion

string

param AssociationVersion

This parameter is provided for concurrency control purposes. You must specify the latest association version in the service. If you want to ensure that this request succeeds, either specify $LATEST , or omit this parameter.

type AutomationTargetParameterName

string

param AutomationTargetParameterName

Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

type MaxErrors

string

param MaxErrors

The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

type MaxConcurrency

string

param MaxConcurrency

The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

type ComplianceSeverity

string

param ComplianceSeverity

The severity level to assign to the association.

type SyncCompliance

string

param SyncCompliance

The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

By default, all associations use AUTO mode.

type ApplyOnlyAtCronInterval

boolean

param ApplyOnlyAtCronInterval

By default, when you update an association, the system runs it immediately after it is updated and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you update it. This parameter isn't supported for rate expressions.

If you chose this option when you created an association and later you edit that association or you make changes to the SSM document on which that association is based (by using the Documents page in the console), State Manager applies the association at the next specified cron interval. For example, if you chose the Latest version of an SSM document when you created an association and you edit the association by choosing a different document version on the Documents page, State Manager applies the association at the next specified cron interval if you previously selected this option. If this option wasn't selected, State Manager immediately runs the association.

You can reset this option. To do so, specify the no-apply-only-at-cron-interval parameter when you update the association from the command line. This parameter forces the association to run immediately after updating it and according to the interval specified.

type CalendarNames

list

param CalendarNames

The names or Amazon Resource Names (ARNs) of the Change Calendar type documents you want to gate your associations under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

  • (string) --

type TargetLocations

list

param TargetLocations

A location is a combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association. Use this action to update an association in multiple Regions and multiple accounts.

  • (dict) --

    The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

    • Accounts (list) --

      The Amazon Web Services accounts targeted by the current Automation execution.

      • (string) --

    • Regions (list) --

      The Amazon Web Services Regions targeted by the current Automation execution.

      • (string) --

    • TargetLocationMaxConcurrency (string) --

      The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

    • TargetLocationMaxErrors (string) --

      The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

    • ExecutionRoleName (string) --

      The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

    • TargetLocationAlarmConfiguration (dict) --

      The details for the CloudWatch alarm you want to apply to an automation or command.

      • IgnorePollAlarmFailure (boolean) --

        If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

      • Alarms (list) -- [REQUIRED]

        The name of the CloudWatch alarm specified in the configuration.

        • (dict) --

          A CloudWatch alarm you apply to an automation or command.

          • Name (string) -- [REQUIRED]

            The name of your CloudWatch alarm.

type ScheduleOffset

integer

param ScheduleOffset

Number of days to wait after the scheduled day to run an association. For example, if you specified a cron schedule of cron(0 0 ? * THU#2 *) , you could specify an offset of 3 to run the association each Sunday after the second Thursday of the month. For more information about cron schedules for associations, see Reference: Cron and rate expressions for Systems Manager in the Amazon Web Services Systems Manager User Guide .

Note

To use offsets, you must specify the ApplyOnlyAtCronInterval parameter. This option tells the system not to run an association immediately after you create it.

type TargetMaps

list

param TargetMaps

A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

  • (dict) --

    • (string) --

      • (list) --

        • (string) --

type AlarmConfiguration

dict

param AlarmConfiguration

The details for the CloudWatch alarm you want to apply to an automation or command.

  • IgnorePollAlarmFailure (boolean) --

    If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

  • Alarms (list) -- [REQUIRED]

    The name of the CloudWatch alarm specified in the configuration.

    • (dict) --

      A CloudWatch alarm you apply to an automation or command.

      • Name (string) -- [REQUIRED]

        The name of your CloudWatch alarm.

rtype

dict

returns

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'AssociationVersion': 'string',
        'Date': datetime(2015, 1, 1),
        'LastUpdateAssociationDate': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        },
        'Overview': {
            'Status': 'string',
            'DetailedStatus': 'string',
            'AssociationStatusAggregatedCount': {
                'string': 123
            }
        },
        'DocumentVersion': 'string',
        'AutomationTargetParameterName': 'string',
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'AssociationId': 'string',
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'ScheduleExpression': 'string',
        'OutputLocation': {
            'S3Location': {
                'OutputS3Region': 'string',
                'OutputS3BucketName': 'string',
                'OutputS3KeyPrefix': 'string'
            }
        },
        'LastExecutionDate': datetime(2015, 1, 1),
        'LastSuccessfulExecutionDate': datetime(2015, 1, 1),
        'AssociationName': 'string',
        'MaxErrors': 'string',
        'MaxConcurrency': 'string',
        'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
        'SyncCompliance': 'AUTO'|'MANUAL',
        'ApplyOnlyAtCronInterval': True|False,
        'CalendarNames': [
            'string',
        ],
        'TargetLocations': [
            {
                'Accounts': [
                    'string',
                ],
                'Regions': [
                    'string',
                ],
                'TargetLocationMaxConcurrency': 'string',
                'TargetLocationMaxErrors': 'string',
                'ExecutionRoleName': 'string',
                'TargetLocationAlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
        ],
        'ScheduleOffset': 123,
        'TargetMaps': [
            {
                'string': [
                    'string',
                ]
            },
        ],
        'AlarmConfiguration': {
            'IgnorePollAlarmFailure': True|False,
            'Alarms': [
                {
                    'Name': 'string'
                },
            ]
        },
        'TriggeredAlarms': [
            {
                'Name': 'string',
                'State': 'UNKNOWN'|'ALARM'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      The description of the association that was updated.

      • Name (string) --

        The name of the SSM document.

      • InstanceId (string) --

        The managed node ID.

      • AssociationVersion (string) --

        The association version.

      • Date (datetime) --

        The date when the association was made.

      • LastUpdateAssociationDate (datetime) --

        The date when the association was last updated.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.

      • Overview (dict) --

        Information about the association.

        • Status (string) --

          The status of the association. Status can be: Pending, Success, or Failed.

        • DetailedStatus (string) --

          A detailed status of the association.

        • AssociationStatusAggregatedCount (dict) --

          Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.

          • (string) --

            • (integer) --

      • DocumentVersion (string) --

        The document version.

      • AutomationTargetParameterName (string) --

        Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

      • Parameters (dict) --

        A description of the parameters for a document.

        • (string) --

          • (list) --

            • (string) --

      • AssociationId (string) --

        The association ID.

      • Targets (list) --

        The managed nodes targeted by the request.

        • (dict) --

          An array of search criteria that targets managed nodes using a key-value pair that you specify.

          Note

          One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

          Supported formats include the following.

          • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

          • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

          • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

          • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

          For example:

          • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

          • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

          • Key=tag-key,Values=Name,Instance-Type,CostCenter

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

          • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

          • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

          For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

          • Key (string) --

            User-defined criteria for sending commands that target managed nodes that meet the criteria.

          • Values (list) --

            User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

            Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

            • (string) --

      • ScheduleExpression (string) --

        A cron expression that specifies a schedule when the association runs.

      • OutputLocation (dict) --

        An S3 bucket where you want to store the output details of the request.

        • S3Location (dict) --

          An S3 bucket where you want to store the results of this request.

          • OutputS3Region (string) --

            The Amazon Web Services Region of the S3 bucket.

          • OutputS3BucketName (string) --

            The name of the S3 bucket.

          • OutputS3KeyPrefix (string) --

            The S3 bucket subfolder.

      • LastExecutionDate (datetime) --

        The date on which the association was last run.

      • LastSuccessfulExecutionDate (datetime) --

        The last date on which the association was successfully run.

      • AssociationName (string) --

        The association name.

      • MaxErrors (string) --

        The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

        Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

      • MaxConcurrency (string) --

        The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

        If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

      • ComplianceSeverity (string) --

        The severity level that is assigned to the association.

      • SyncCompliance (string) --

        The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

        In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

        By default, all associations use AUTO mode.

      • ApplyOnlyAtCronInterval (boolean) --

        By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

      • CalendarNames (list) --

        The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

        • (string) --

      • TargetLocations (list) --

        The combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association.

        • (dict) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

          • Accounts (list) --

            The Amazon Web Services accounts targeted by the current Automation execution.

            • (string) --

          • Regions (list) --

            The Amazon Web Services Regions targeted by the current Automation execution.

            • (string) --

          • TargetLocationMaxConcurrency (string) --

            The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

          • TargetLocationMaxErrors (string) --

            The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

          • ExecutionRoleName (string) --

            The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

          • TargetLocationAlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

      • ScheduleOffset (integer) --

        Number of days to wait after the scheduled day to run an association.

      • TargetMaps (list) --

        A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

        • (dict) --

          • (string) --

            • (list) --

              • (string) --

      • AlarmConfiguration (dict) --

        The details for the CloudWatch alarm you want to apply to an automation or command.

        • IgnorePollAlarmFailure (boolean) --

          If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

        • Alarms (list) --

          The name of the CloudWatch alarm specified in the configuration.

          • (dict) --

            A CloudWatch alarm you apply to an automation or command.

            • Name (string) --

              The name of your CloudWatch alarm.

      • TriggeredAlarms (list) --

        The CloudWatch alarm that was invoked during the association.

        • (dict) --

          The details about the state of your CloudWatch alarm.

          • Name (string) --

            The name of your CloudWatch alarm.

          • State (string) --

            The state of your CloudWatch alarm.

UpdateAssociationStatus (updated) Link ¶
Changes (response)
{'AssociationDescription': {'TargetLocations': {'TargetLocationAlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                                                     'IgnorePollAlarmFailure': 'boolean'}}}}

Updates the status of the Amazon Web Services Systems Manager document (SSM document) associated with the specified managed node.

UpdateAssociationStatus is primarily used by the Amazon Web Services Systems Manager Agent (SSM Agent) to report status updates about your associations and is only used for associations created with the InstanceId legacy parameter.

See also: AWS API Documentation

Request Syntax

client.update_association_status(
    Name='string',
    InstanceId='string',
    AssociationStatus={
        'Date': datetime(2015, 1, 1),
        'Name': 'Pending'|'Success'|'Failed',
        'Message': 'string',
        'AdditionalInfo': 'string'
    }
)
type Name

string

param Name

[REQUIRED]

The name of the SSM document.

type InstanceId

string

param InstanceId

[REQUIRED]

The managed node ID.

type AssociationStatus

dict

param AssociationStatus

[REQUIRED]

The association status.

  • Date (datetime) -- [REQUIRED]

    The date when the status changed.

  • Name (string) -- [REQUIRED]

    The status.

  • Message (string) -- [REQUIRED]

    The reason for the status.

  • AdditionalInfo (string) --

    A user-defined string.

rtype

dict

returns

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'AssociationVersion': 'string',
        'Date': datetime(2015, 1, 1),
        'LastUpdateAssociationDate': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        },
        'Overview': {
            'Status': 'string',
            'DetailedStatus': 'string',
            'AssociationStatusAggregatedCount': {
                'string': 123
            }
        },
        'DocumentVersion': 'string',
        'AutomationTargetParameterName': 'string',
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'AssociationId': 'string',
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'ScheduleExpression': 'string',
        'OutputLocation': {
            'S3Location': {
                'OutputS3Region': 'string',
                'OutputS3BucketName': 'string',
                'OutputS3KeyPrefix': 'string'
            }
        },
        'LastExecutionDate': datetime(2015, 1, 1),
        'LastSuccessfulExecutionDate': datetime(2015, 1, 1),
        'AssociationName': 'string',
        'MaxErrors': 'string',
        'MaxConcurrency': 'string',
        'ComplianceSeverity': 'CRITICAL'|'HIGH'|'MEDIUM'|'LOW'|'UNSPECIFIED',
        'SyncCompliance': 'AUTO'|'MANUAL',
        'ApplyOnlyAtCronInterval': True|False,
        'CalendarNames': [
            'string',
        ],
        'TargetLocations': [
            {
                'Accounts': [
                    'string',
                ],
                'Regions': [
                    'string',
                ],
                'TargetLocationMaxConcurrency': 'string',
                'TargetLocationMaxErrors': 'string',
                'ExecutionRoleName': 'string',
                'TargetLocationAlarmConfiguration': {
                    'IgnorePollAlarmFailure': True|False,
                    'Alarms': [
                        {
                            'Name': 'string'
                        },
                    ]
                }
            },
        ],
        'ScheduleOffset': 123,
        'TargetMaps': [
            {
                'string': [
                    'string',
                ]
            },
        ],
        'AlarmConfiguration': {
            'IgnorePollAlarmFailure': True|False,
            'Alarms': [
                {
                    'Name': 'string'
                },
            ]
        },
        'TriggeredAlarms': [
            {
                'Name': 'string',
                'State': 'UNKNOWN'|'ALARM'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      Information about the association.

      • Name (string) --

        The name of the SSM document.

      • InstanceId (string) --

        The managed node ID.

      • AssociationVersion (string) --

        The association version.

      • Date (datetime) --

        The date when the association was made.

      • LastUpdateAssociationDate (datetime) --

        The date when the association was last updated.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.

      • Overview (dict) --

        Information about the association.

        • Status (string) --

          The status of the association. Status can be: Pending, Success, or Failed.

        • DetailedStatus (string) --

          A detailed status of the association.

        • AssociationStatusAggregatedCount (dict) --

          Returns the number of targets for the association status. For example, if you created an association with two managed nodes, and one of them was successful, this would return the count of managed nodes by status.

          • (string) --

            • (integer) --

      • DocumentVersion (string) --

        The document version.

      • AutomationTargetParameterName (string) --

        Choose the parameter that will define how your automation will branch out. This target is required for associations that use an Automation runbook and target resources by using rate controls. Automation is a capability of Amazon Web Services Systems Manager.

      • Parameters (dict) --

        A description of the parameters for a document.

        • (string) --

          • (list) --

            • (string) --

      • AssociationId (string) --

        The association ID.

      • Targets (list) --

        The managed nodes targeted by the request.

        • (dict) --

          An array of search criteria that targets managed nodes using a key-value pair that you specify.

          Note

          One or more targets must be specified for maintenance window Run Command-type tasks. Depending on the task, targets are optional for other maintenance window task types (Automation, Lambda, and Step Functions). For more information about running tasks that don't specify targets, see Registering maintenance window tasks without targets in the Amazon Web Services Systems Manager User Guide .

          Supported formats include the following.

          • Key=InstanceIds,Values=<instance-id-1>,<instance-id-2>,<instance-id-3>

          • Key=tag:<my-tag-key>,Values=<my-tag-value-1>,<my-tag-value-2>

          • Key=tag-key,Values=<my-tag-key-1>,<my-tag-key-2>

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=<resource-group-name>

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>,<resource-type-2>

          • Automation targets only : Key=ResourceGroup;Values=<resource-group-name>

          For example:

          • Key=InstanceIds,Values=i-02573cafcfEXAMPLE,i-0471e04240EXAMPLE,i-07782c72faEXAMPLE

          • Key=tag:CostCenter,Values=CostCenter1,CostCenter2,CostCenter3

          • Key=tag-key,Values=Name,Instance-Type,CostCenter

          • Run Command and Maintenance window targets only : Key=resource-groups:Name,Values=ProductionResourceGroup This example demonstrates how to target all resources in the resource group ProductionResourceGroup in your maintenance window.

          • Maintenance window targets only : Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC This example demonstrates how to target only Amazon Elastic Compute Cloud (Amazon EC2) instances and VPCs in your maintenance window.

          • Automation targets only : Key=ResourceGroup,Values=MyResourceGroup

          • State Manager association targets only : Key=InstanceIds,Values=* This example demonstrates how to target all managed instances in the Amazon Web Services Region where the association was created.

          For more information about how to send commands that target managed nodes using Key,Value parameters, see Targeting multiple instances in the Amazon Web Services Systems Manager User Guide .

          • Key (string) --

            User-defined criteria for sending commands that target managed nodes that meet the criteria.

          • Values (list) --

            User-defined criteria that maps to Key . For example, if you specified tag:ServerRole , you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer .

            Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50.

            • (string) --

      • ScheduleExpression (string) --

        A cron expression that specifies a schedule when the association runs.

      • OutputLocation (dict) --

        An S3 bucket where you want to store the output details of the request.

        • S3Location (dict) --

          An S3 bucket where you want to store the results of this request.

          • OutputS3Region (string) --

            The Amazon Web Services Region of the S3 bucket.

          • OutputS3BucketName (string) --

            The name of the S3 bucket.

          • OutputS3KeyPrefix (string) --

            The S3 bucket subfolder.

      • LastExecutionDate (datetime) --

        The date on which the association was last run.

      • LastSuccessfulExecutionDate (datetime) --

        The last date on which the association was successfully run.

      • AssociationName (string) --

        The association name.

      • MaxErrors (string) --

        The number of errors that are allowed before the system stops sending requests to run the association 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 sending requests when the fourth error is received. If you specify 0, then the system stops sending requests after the first error is returned. If you run an association on 50 managed nodes and set MaxError to 10%, then the system stops sending the request when the sixth error is received.

        Executions that are already running an association when MaxErrors 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 MaxConcurrency to 1 so that executions proceed one at a time.

      • MaxConcurrency (string) --

        The maximum number of targets allowed to run the association at the same time. You can specify a number, for example 10, or a percentage of the target set, for example 10%. The default value is 100%, which means all targets run the association at the same time.

        If a new managed node starts and attempts to run an association while Systems Manager is running MaxConcurrency associations, the association is allowed to run. During the next association interval, the new managed node will process its association within the limit specified for MaxConcurrency .

      • ComplianceSeverity (string) --

        The severity level that is assigned to the association.

      • SyncCompliance (string) --

        The mode for generating association compliance. You can specify AUTO or MANUAL . In AUTO mode, the system uses the status of the association execution to determine the compliance status. If the association execution runs successfully, then the association is COMPLIANT . If the association execution doesn't run successfully, the association is NON-COMPLIANT .

        In MANUAL mode, you must specify the AssociationId as a parameter for the PutComplianceItems API operation. In this case, compliance data isn't managed by State Manager, a capability of Amazon Web Services Systems Manager. It is managed by your direct call to the PutComplianceItems API operation.

        By default, all associations use AUTO mode.

      • ApplyOnlyAtCronInterval (boolean) --

        By default, when you create a new associations, the system runs it immediately after it is created and then according to the schedule you specified. Specify this option if you don't want an association to run immediately after you create it. This parameter isn't supported for rate expressions.

      • CalendarNames (list) --

        The names or Amazon Resource Names (ARNs) of the Change Calendar type documents your associations are gated under. The associations only run when that change calendar is open. For more information, see Amazon Web Services Systems Manager Change Calendar.

        • (string) --

      • TargetLocations (list) --

        The combination of Amazon Web Services Regions and Amazon Web Services accounts where you want to run the association.

        • (dict) --

          The combination of Amazon Web Services Regions and Amazon Web Services accounts targeted by the current Automation execution.

          • Accounts (list) --

            The Amazon Web Services accounts targeted by the current Automation execution.

            • (string) --

          • Regions (list) --

            The Amazon Web Services Regions targeted by the current Automation execution.

            • (string) --

          • TargetLocationMaxConcurrency (string) --

            The maximum number of Amazon Web Services Regions and Amazon Web Services accounts allowed to run the Automation concurrently.

          • TargetLocationMaxErrors (string) --

            The maximum number of errors allowed before the system stops queueing additional Automation executions for the currently running Automation.

          • ExecutionRoleName (string) --

            The Automation execution role used by the currently running Automation. If not specified, the default value is AWS-SystemsManager-AutomationExecutionRole .

          • TargetLocationAlarmConfiguration (dict) --

            The details for the CloudWatch alarm you want to apply to an automation or command.

            • IgnorePollAlarmFailure (boolean) --

              If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

            • Alarms (list) --

              The name of the CloudWatch alarm specified in the configuration.

              • (dict) --

                A CloudWatch alarm you apply to an automation or command.

                • Name (string) --

                  The name of your CloudWatch alarm.

      • ScheduleOffset (integer) --

        Number of days to wait after the scheduled day to run an association.

      • TargetMaps (list) --

        A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.

        • (dict) --

          • (string) --

            • (list) --

              • (string) --

      • AlarmConfiguration (dict) --

        The details for the CloudWatch alarm you want to apply to an automation or command.

        • IgnorePollAlarmFailure (boolean) --

          If you specify true for this value, your automation or command continue to run even if we can't gather information about the state of your CloudWatch alarm. The default value is false .

        • Alarms (list) --

          The name of the CloudWatch alarm specified in the configuration.

          • (dict) --

            A CloudWatch alarm you apply to an automation or command.

            • Name (string) --

              The name of your CloudWatch alarm.

      • TriggeredAlarms (list) --

        The CloudWatch alarm that was invoked during the association.

        • (dict) --

          The details about the state of your CloudWatch alarm.

          • Name (string) --

            The name of your CloudWatch alarm.

          • State (string) --

            The state of your CloudWatch alarm.