Amazon Simple Systems Manager (SSM)

2022/09/26 - Amazon Simple Systems Manager (SSM) - 17 updated api methods

Changes  This release includes support for applying a CloudWatch alarm to Systems Manager capabilities like Automation, Run Command, State Manager, and Maintenance Windows.

CreateAssociation (updated) Link ¶
Changes (request, response)
Request
{'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                        'IgnorePollAlarmFailure': 'boolean'}}
Response
{'AssociationDescription': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                   'IgnorePollAlarmFailure': 'boolean'},
                            'TriggeredAlarms': [{'Name': 'string',
                                                 'State': 'UNKNOWN | ALARM'}]}}

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'
        },
    ],
    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 .

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

Optional metadata that you assign to a resource. 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 association to identify the type of resource to which it applies, the environment, or the purpose of the association.

  • (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'
            },
        ],
        '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 .

      • 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': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                    'IgnorePollAlarmFailure': 'boolean'}}}
Response
{'Failed': {'Entry': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                             'IgnorePollAlarmFailure': 'boolean'}}},
 'Successful': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                       'IgnorePollAlarmFailure': 'boolean'},
                'TriggeredAlarms': [{'Name': 'string',
                                     'State': 'UNKNOWN | ALARM'}]}}

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'
                },
            ],
            '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 .

    • 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'
                },
            ],
            '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'
                    },
                ],
                '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 .

        • 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 .

          • 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': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                   'IgnorePollAlarmFailure': 'boolean'},
                            'TriggeredAlarms': [{'Name': 'string',
                                                 'State': 'UNKNOWN | ALARM'}]}}

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'
            },
        ],
        '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 .

      • 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.

DescribeAssociationExecutions (updated) Link ¶
Changes (response)
{'AssociationExecutions': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                  'IgnorePollAlarmFailure': 'boolean'},
                           'TriggeredAlarms': [{'Name': 'string',
                                                'State': 'UNKNOWN | ALARM'}]}}

Views all executions for a specific association ID.

See also: AWS API Documentation

Request Syntax

client.describe_association_executions(
    AssociationId='string',
    Filters=[
        {
            'Key': 'ExecutionId'|'Status'|'CreatedTime',
            'Value': 'string',
            'Type': 'EQUAL'|'LESS_THAN'|'GREATER_THAN'
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type AssociationId

string

param AssociationId

[REQUIRED]

The association ID for which you want to view execution history details.

type Filters

list

param Filters

Filters for the request. You can specify the following filters and values.

ExecutionId (EQUAL)

Status (EQUAL)

CreatedTime (EQUAL, GREATER_THAN, LESS_THAN)

  • (dict) --

    Filters used in the request.

    • Key (string) -- [REQUIRED]

      The key value used in the request.

    • Value (string) -- [REQUIRED]

      The value specified for the key.

    • Type (string) -- [REQUIRED]

      The filter type specified in the request.

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

{
    'AssociationExecutions': [
        {
            'AssociationId': 'string',
            'AssociationVersion': 'string',
            'ExecutionId': 'string',
            'Status': 'string',
            'DetailedStatus': 'string',
            'CreatedTime': datetime(2015, 1, 1),
            'LastExecutionDate': datetime(2015, 1, 1),
            'ResourceCountByStatus': 'string',
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            },
            'TriggeredAlarms': [
                {
                    'Name': 'string',
                    'State': 'UNKNOWN'|'ALARM'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AssociationExecutions (list) --

      A list of the executions for the specified association ID.

      • (dict) --

        Includes information about the specified association.

        • AssociationId (string) --

          The association ID.

        • AssociationVersion (string) --

          The association version.

        • ExecutionId (string) --

          The execution ID for the association.

        • Status (string) --

          The status of the association execution.

        • DetailedStatus (string) --

          Detailed status information about the execution.

        • CreatedTime (datetime) --

          The time the execution started.

        • LastExecutionDate (datetime) --

          The date of the last execution.

        • ResourceCountByStatus (string) --

          An aggregate status of the resources in the execution based on the status type.

        • 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 alarms that were invoked by 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.

    • NextToken (string) --

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

DescribeAutomationExecutions (updated) Link ¶
Changes (response)
{'AutomationExecutionMetadataList': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                            'IgnorePollAlarmFailure': 'boolean'},
                                     'TriggeredAlarms': [{'Name': 'string',
                                                          'State': 'UNKNOWN | '
                                                                   'ALARM'}]}}

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'
                        },
                    ]
                },
            ],
            '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 .

        • 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.

DescribeMaintenanceWindowExecutionTasks (updated) Link ¶
Changes (response)
{'WindowExecutionTaskIdentities': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                          'IgnorePollAlarmFailure': 'boolean'},
                                   'TriggeredAlarms': [{'Name': 'string',
                                                        'State': 'UNKNOWN | '
                                                                 'ALARM'}]}}

For a given maintenance window execution, lists the tasks that were run.

See also: AWS API Documentation

Request Syntax

client.describe_maintenance_window_execution_tasks(
    WindowExecutionId='string',
    Filters=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type WindowExecutionId

string

param WindowExecutionId

[REQUIRED]

The ID of the maintenance window execution whose task executions should be retrieved.

type Filters

list

param Filters

Optional filters used to scope down the returned tasks. The supported filter key is STATUS with the corresponding values PENDING , IN_PROGRESS , SUCCESS , FAILED , TIMED_OUT , CANCELLING , and CANCELLED .

  • (dict) --

    Filter used in the request. Supported filter keys depend on the API operation that includes the filter. API operations that use MaintenanceWindowFilter> include the following:

    • DescribeMaintenanceWindowExecutions

    • DescribeMaintenanceWindowExecutionTaskInvocations

    • DescribeMaintenanceWindowExecutionTasks

    • DescribeMaintenanceWindows

    • DescribeMaintenanceWindowTargets

    • DescribeMaintenanceWindowTasks

    • Key (string) --

      The name of the filter.

    • Values (list) --

      The filter values.

      • (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

{
    'WindowExecutionTaskIdentities': [
        {
            'WindowExecutionId': 'string',
            'TaskExecutionId': 'string',
            'Status': 'PENDING'|'IN_PROGRESS'|'SUCCESS'|'FAILED'|'TIMED_OUT'|'CANCELLING'|'CANCELLED'|'SKIPPED_OVERLAPPING',
            'StatusDetails': 'string',
            'StartTime': datetime(2015, 1, 1),
            'EndTime': datetime(2015, 1, 1),
            'TaskArn': 'string',
            'TaskType': 'RUN_COMMAND'|'AUTOMATION'|'STEP_FUNCTIONS'|'LAMBDA',
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            },
            'TriggeredAlarms': [
                {
                    'Name': 'string',
                    'State': 'UNKNOWN'|'ALARM'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • WindowExecutionTaskIdentities (list) --

      Information about the task executions.

      • (dict) --

        Information about a task execution performed as part of a maintenance window execution.

        • WindowExecutionId (string) --

          The ID of the maintenance window execution that ran the task.

        • TaskExecutionId (string) --

          The ID of the specific task execution in the maintenance window execution.

        • Status (string) --

          The status of the task execution.

        • StatusDetails (string) --

          The details explaining the status of the task execution. Not available for all status values.

        • StartTime (datetime) --

          The time the task execution started.

        • EndTime (datetime) --

          The time the task execution finished.

        • TaskArn (string) --

          The Amazon Resource Name (ARN) of the task that ran.

        • TaskType (string) --

          The type of task that ran.

        • AlarmConfiguration (dict) --

          The details for the CloudWatch alarm applied to your maintenance window task.

          • 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 maintenance window task.

          • (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.

DescribeMaintenanceWindowTasks (updated) Link ¶
Changes (response)
{'Tasks': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                  'IgnorePollAlarmFailure': 'boolean'}}}

Lists the tasks in a maintenance window.

Note

For maintenance window tasks without a specified target, you can't supply values for --max-errors and --max-concurrency . Instead, the system inserts a placeholder value of 1 , which may be reported in the response to this command. These values don't affect the running of your task and can be ignored.

See also: AWS API Documentation

Request Syntax

client.describe_maintenance_window_tasks(
    WindowId='string',
    Filters=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type WindowId

string

param WindowId

[REQUIRED]

The ID of the maintenance window whose tasks should be retrieved.

type Filters

list

param Filters

Optional filters used to narrow down the scope of the returned tasks. The supported filter keys are WindowTaskId , TaskArn , Priority , and TaskType .

  • (dict) --

    Filter used in the request. Supported filter keys depend on the API operation that includes the filter. API operations that use MaintenanceWindowFilter> include the following:

    • DescribeMaintenanceWindowExecutions

    • DescribeMaintenanceWindowExecutionTaskInvocations

    • DescribeMaintenanceWindowExecutionTasks

    • DescribeMaintenanceWindows

    • DescribeMaintenanceWindowTargets

    • DescribeMaintenanceWindowTasks

    • Key (string) --

      The name of the filter.

    • Values (list) --

      The filter values.

      • (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

{
    'Tasks': [
        {
            'WindowId': 'string',
            'WindowTaskId': 'string',
            'TaskArn': 'string',
            'Type': 'RUN_COMMAND'|'AUTOMATION'|'STEP_FUNCTIONS'|'LAMBDA',
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'TaskParameters': {
                'string': {
                    'Values': [
                        'string',
                    ]
                }
            },
            'Priority': 123,
            'LoggingInfo': {
                'S3BucketName': 'string',
                'S3KeyPrefix': 'string',
                'S3Region': 'string'
            },
            'ServiceRoleArn': 'string',
            'MaxConcurrency': 'string',
            'MaxErrors': 'string',
            'Name': 'string',
            'Description': 'string',
            'CutoffBehavior': 'CONTINUE_TASK'|'CANCEL_TASK',
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Tasks (list) --

      Information about the tasks in the maintenance window.

      • (dict) --

        Information about a task defined for a maintenance window.

        • WindowId (string) --

          The ID of the maintenance window where the task is registered.

        • WindowTaskId (string) --

          The task ID.

        • TaskArn (string) --

          The resource that the task uses during execution. For RUN_COMMAND and AUTOMATION task types, TaskArn is the Amazon Web Services Systems Manager (SSM document) name or ARN. For LAMBDA tasks, it's the function name or ARN. For STEP_FUNCTIONS tasks, it's the state machine ARN.

        • Type (string) --

          The type of task.

        • Targets (list) --

          The targets (either managed nodes or tags). Managed nodes are specified using Key=instanceids,Values=<instanceid1>,<instanceid2> . Tags are specified using Key=<tag name>,Values=<tag value> .

          • (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) --

        • TaskParameters (dict) --

          The parameters that should be passed to the task when it is run.

          Note

          TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

          • (string) --

            • (dict) --

              Defines the values for a task parameter.

              • Values (list) --

                This field contains an array of 0 or more strings, each 1 to 255 characters in length.

                • (string) --

        • Priority (integer) --

          The priority of the task in the maintenance window. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.

        • LoggingInfo (dict) --

          Information about an S3 bucket to write task-level logs to.

          Note

          LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

          • S3BucketName (string) --

            The name of an S3 bucket where execution logs are stored .

          • S3KeyPrefix (string) --

            (Optional) The S3 bucket subfolder.

          • S3Region (string) --

            The Amazon Web Services Region where the S3 bucket is located.

        • ServiceRoleArn (string) --

          The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

        • MaxConcurrency (string) --

          The maximum number of targets this task can be run for, in parallel.

          Note

          Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

          For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

        • MaxErrors (string) --

          The maximum number of errors allowed before this task stops being scheduled.

          Note

          Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

          For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

        • Name (string) --

          The task name.

        • Description (string) --

          A description of the task.

        • CutoffBehavior (string) --

          The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

        • AlarmConfiguration (dict) --

          The details for the CloudWatch alarm applied to your maintenance window task.

          • 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.

    • 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': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                'IgnorePollAlarmFailure': 'boolean'},
                         'TriggeredAlarms': [{'Name': 'string',
                                              'State': 'UNKNOWN | ALARM'}]}}

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'
                }
            },
        ],
        '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'
            },
        ],
        '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'
                    },
                ]
            },
        ],
        '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 .

      • 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 .

      • 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 .

      • 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.

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

Retrieves the details about a specific task run as part of a maintenance window execution.

See also: AWS API Documentation

Request Syntax

client.get_maintenance_window_execution_task(
    WindowExecutionId='string',
    TaskId='string'
)
type WindowExecutionId

string

param WindowExecutionId

[REQUIRED]

The ID of the maintenance window execution that includes the task.

type TaskId

string

param TaskId

[REQUIRED]

The ID of the specific task execution in the maintenance window task that should be retrieved.

rtype

dict

returns

Response Syntax

{
    'WindowExecutionId': 'string',
    'TaskExecutionId': 'string',
    'TaskArn': 'string',
    'ServiceRole': 'string',
    'Type': 'RUN_COMMAND'|'AUTOMATION'|'STEP_FUNCTIONS'|'LAMBDA',
    'TaskParameters': [
        {
            'string': {
                'Values': [
                    'string',
                ]
            }
        },
    ],
    'Priority': 123,
    'MaxConcurrency': 'string',
    'MaxErrors': 'string',
    'Status': 'PENDING'|'IN_PROGRESS'|'SUCCESS'|'FAILED'|'TIMED_OUT'|'CANCELLING'|'CANCELLED'|'SKIPPED_OVERLAPPING',
    'StatusDetails': 'string',
    'StartTime': datetime(2015, 1, 1),
    'EndTime': datetime(2015, 1, 1),
    'AlarmConfiguration': {
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    },
    'TriggeredAlarms': [
        {
            'Name': 'string',
            'State': 'UNKNOWN'|'ALARM'
        },
    ]
}

Response Structure

  • (dict) --

    • WindowExecutionId (string) --

      The ID of the maintenance window execution that includes the task.

    • TaskExecutionId (string) --

      The ID of the specific task execution in the maintenance window task that was retrieved.

    • TaskArn (string) --

      The Amazon Resource Name (ARN) of the task that ran.

    • ServiceRole (string) --

      The role that was assumed when running the task.

    • Type (string) --

      The type of task that was run.

    • TaskParameters (list) --

      The parameters passed to the task when it was run.

      Note

      TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      The map has the following format:

      • Key : string, between 1 and 255 characters

      • Value : an array of strings, each between 1 and 255 characters

      • (dict) --

        • (string) --

          • (dict) --

            Defines the values for a task parameter.

            • Values (list) --

              This field contains an array of 0 or more strings, each 1 to 255 characters in length.

              • (string) --

    • Priority (integer) --

      The priority of the task.

    • MaxConcurrency (string) --

      The defined maximum number of task executions that could be run in parallel.

    • MaxErrors (string) --

      The defined maximum number of task execution errors allowed before scheduling of the task execution would have been stopped.

    • Status (string) --

      The status of the task.

    • StatusDetails (string) --

      The details explaining the status. Not available for all status values.

    • StartTime (datetime) --

      The time the task execution started.

    • EndTime (datetime) --

      The time the task execution completed.

    • AlarmConfiguration (dict) --

      The details for the CloudWatch alarm you applied to your maintenance window task.

      • 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 maintenance window task.

      • (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.

GetMaintenanceWindowTask (updated) Link ¶
Changes (response)
{'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                        'IgnorePollAlarmFailure': 'boolean'}}

Retrieves the details of a maintenance window task.

Note

For maintenance window tasks without a specified target, you can't supply values for --max-errors and --max-concurrency . Instead, the system inserts a placeholder value of 1 , which may be reported in the response to this command. These values don't affect the running of your task and can be ignored.

To retrieve a list of tasks in a maintenance window, instead use the DescribeMaintenanceWindowTasks command.

See also: AWS API Documentation

Request Syntax

client.get_maintenance_window_task(
    WindowId='string',
    WindowTaskId='string'
)
type WindowId

string

param WindowId

[REQUIRED]

The maintenance window ID that includes the task to retrieve.

type WindowTaskId

string

param WindowTaskId

[REQUIRED]

The maintenance window task ID to retrieve.

rtype

dict

returns

Response Syntax

{
    'WindowId': 'string',
    'WindowTaskId': 'string',
    'Targets': [
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    'TaskArn': 'string',
    'ServiceRoleArn': 'string',
    'TaskType': 'RUN_COMMAND'|'AUTOMATION'|'STEP_FUNCTIONS'|'LAMBDA',
    'TaskParameters': {
        'string': {
            'Values': [
                'string',
            ]
        }
    },
    'TaskInvocationParameters': {
        'RunCommand': {
            'Comment': 'string',
            'CloudWatchOutputConfig': {
                'CloudWatchLogGroupName': 'string',
                'CloudWatchOutputEnabled': True|False
            },
            'DocumentHash': 'string',
            'DocumentHashType': 'Sha256'|'Sha1',
            'DocumentVersion': 'string',
            'NotificationConfig': {
                'NotificationArn': 'string',
                'NotificationEvents': [
                    'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
                ],
                'NotificationType': 'Command'|'Invocation'
            },
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'ServiceRoleArn': 'string',
            'TimeoutSeconds': 123
        },
        'Automation': {
            'DocumentVersion': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            }
        },
        'StepFunctions': {
            'Input': 'string',
            'Name': 'string'
        },
        'Lambda': {
            'ClientContext': 'string',
            'Qualifier': 'string',
            'Payload': b'bytes'
        }
    },
    'Priority': 123,
    'MaxConcurrency': 'string',
    'MaxErrors': 'string',
    'LoggingInfo': {
        'S3BucketName': 'string',
        'S3KeyPrefix': 'string',
        'S3Region': 'string'
    },
    'Name': 'string',
    'Description': 'string',
    'CutoffBehavior': 'CONTINUE_TASK'|'CANCEL_TASK',
    'AlarmConfiguration': {
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • WindowId (string) --

      The retrieved maintenance window ID.

    • WindowTaskId (string) --

      The retrieved maintenance window task ID.

    • Targets (list) --

      The targets where the task should run.

      • (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) --

    • TaskArn (string) --

      The resource that the task used during execution. For RUN_COMMAND and AUTOMATION task types, the value of TaskArn is the SSM document name/ARN. For LAMBDA tasks, the value is the function name/ARN. For STEP_FUNCTIONS tasks, the value is the state machine ARN.

    • ServiceRoleArn (string) --

      The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

    • TaskType (string) --

      The type of task to run.

    • TaskParameters (dict) --

      The parameters to pass to the task when it runs.

      Note

      TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      • (string) --

        • (dict) --

          Defines the values for a task parameter.

          • Values (list) --

            This field contains an array of 0 or more strings, each 1 to 255 characters in length.

            • (string) --

    • TaskInvocationParameters (dict) --

      The parameters to pass to the task when it runs.

      • RunCommand (dict) --

        The parameters for a RUN_COMMAND task type.

        • Comment (string) --

          Information about the commands to run.

        • CloudWatchOutputConfig (dict) --

          Configuration options for sending command output to Amazon CloudWatch Logs.

          • CloudWatchLogGroupName (string) --

            The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

            ``aws/ssm/SystemsManagerDocumentName ``

          • CloudWatchOutputEnabled (boolean) --

            Enables Systems Manager to send command output to CloudWatch Logs.

        • DocumentHash (string) --

          The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.

        • DocumentHashType (string) --

          SHA-256 or SHA-1. SHA-1 hashes have been deprecated.

        • DocumentVersion (string) --

          The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify $DEFAULT , $LATEST , or a specific version number. If you run commands by using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

          --document-version "\$DEFAULT"

          --document-version "\$LATEST"

          --document-version "3"

        • NotificationConfig (dict) --

          Configurations for sending notifications about command status changes on a per-managed node basis.

          • NotificationArn (string) --

            An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

          • NotificationEvents (list) --

            The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

            • (string) --

          • NotificationType (string) --

            The type of notification.

            • Command : Receive notification when the status of a command changes.

            • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

        • OutputS3BucketName (string) --

          The name of the Amazon Simple Storage Service (Amazon S3) bucket.

        • OutputS3KeyPrefix (string) --

          The S3 bucket subfolder.

        • Parameters (dict) --

          The parameters for the RUN_COMMAND task execution.

          • (string) --

            • (list) --

              • (string) --

        • ServiceRoleArn (string) --

          The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

        • TimeoutSeconds (integer) --

          If this time is reached and the command hasn't already started running, it doesn't run.

      • Automation (dict) --

        The parameters for an AUTOMATION task type.

        • DocumentVersion (string) --

          The version of an Automation runbook to use during task execution.

        • Parameters (dict) --

          The parameters for the AUTOMATION task.

          For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask .

          Note

          LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

          TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

          For AUTOMATION task types, Amazon Web Services Systems Manager ignores any values specified for these parameters.

          • (string) --

            • (list) --

              • (string) --

      • StepFunctions (dict) --

        The parameters for a STEP_FUNCTIONS task type.

        • Input (string) --

          The inputs for the STEP_FUNCTIONS task.

        • Name (string) --

          The name of the STEP_FUNCTIONS task.

      • Lambda (dict) --

        The parameters for a LAMBDA task type.

        • ClientContext (string) --

          Pass client-specific information to the Lambda function that you are invoking. You can then process the client information in your Lambda function as you choose through the context variable.

        • Qualifier (string) --

          (Optional) Specify an Lambda function version or alias name. If you specify a function version, the operation uses the qualified function Amazon Resource Name (ARN) to invoke a specific Lambda function. If you specify an alias name, the operation uses the alias ARN to invoke the Lambda function version to which the alias points.

        • Payload (bytes) --

          JSON to provide to your Lambda function as input.

    • Priority (integer) --

      The priority of the task when it runs. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.

    • MaxConcurrency (string) --

      The maximum number of targets allowed to run this task in parallel.

      Note

      For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 , which may be reported in the response to this command. This value doesn't affect the running of your task and can be ignored.

    • MaxErrors (string) --

      The maximum number of errors allowed before the task stops being scheduled.

      Note

      For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 , which may be reported in the response to this command. This value doesn't affect the running of your task and can be ignored.

    • LoggingInfo (dict) --

      The location in Amazon Simple Storage Service (Amazon S3) where the task results are logged.

      Note

      LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      • S3BucketName (string) --

        The name of an S3 bucket where execution logs are stored .

      • S3KeyPrefix (string) --

        (Optional) The S3 bucket subfolder.

      • S3Region (string) --

        The Amazon Web Services Region where the S3 bucket is located.

    • Name (string) --

      The retrieved task name.

    • Description (string) --

      The retrieved task description.

    • CutoffBehavior (string) --

      The action to take on tasks when the maintenance window cutoff time is reached. CONTINUE_TASK means that tasks continue to run. For Automation, Lambda, Step Functions tasks, CANCEL_TASK means that currently running task invocations continue, but no new task invocations are started. For Run Command tasks, CANCEL_TASK means the system attempts to stop the task by sending a CancelCommand operation.

    • AlarmConfiguration (dict) --

      The details for the CloudWatch alarm you applied to your maintenance window task.

      • 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.

ListCommands (updated) Link ¶
Changes (response)
{'Commands': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                     'IgnorePollAlarmFailure': 'boolean'},
              'TriggeredAlarms': [{'Name': 'string',
                                   'State': 'UNKNOWN | ALARM'}]}}

Lists the commands requested by users of the Amazon Web Services account.

See also: AWS API Documentation

Request Syntax

client.list_commands(
    CommandId='string',
    InstanceId='string',
    MaxResults=123,
    NextToken='string',
    Filters=[
        {
            'key': 'InvokedAfter'|'InvokedBefore'|'Status'|'ExecutionStage'|'DocumentName',
            'value': 'string'
        },
    ]
)
type CommandId

string

param CommandId

(Optional) If provided, lists only the specified command.

type InstanceId

string

param InstanceId

(Optional) Lists commands issued against this managed node ID.

Note

You can't specify a managed node ID in the same command that you specify Status = Pending . This is because the command hasn't reached the managed node yet.

type MaxResults

integer

param MaxResults

(Optional) 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

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

type Filters

list

param Filters

(Optional) One or more filters. Use a filter to return a more specific list of results.

  • (dict) --

    Describes a command filter.

    Note

    A managed node ID can't be specified when a command status is Pending because the command hasn't run on the node yet.

    • key (string) -- [REQUIRED]

      The name of the filter.

      Note

      The ExecutionStage filter can't be used with the ListCommandInvocations operation, only with ListCommands .

    • value (string) -- [REQUIRED]

      The filter value. Valid values for each filter key are as follows:

      • InvokedAfter : Specify a timestamp to limit your results. For example, specify 2021-07-07T00:00:00Z to see a list of command executions occurring July 7, 2021, and later.

      • InvokedBefore : Specify a timestamp to limit your results. For example, specify 2021-07-07T00:00:00Z to see a list of command executions from before July 7, 2021.

      • Status : Specify a valid command status to see a list of all command executions with that status. The status choices depend on the API you call. The status values you can specify for ListCommands are:

        • Pending

        • InProgress

        • Success

        • Cancelled

        • Failed

        • TimedOut (this includes both Delivery and Execution time outs)

        • AccessDenied

        • DeliveryTimedOut

        • ExecutionTimedOut

        • Incomplete

        • NoInstancesInTag

        • LimitExceeded

      The status values you can specify for ListCommandInvocations are:

      • Pending

      • InProgress

      • Delayed

      • Success

      • Cancelled

      • Failed

      • TimedOut (this includes both Delivery and Execution time outs)

      • AccessDenied

      • DeliveryTimedOut

      • ExecutionTimedOut

      • Undeliverable

      • InvalidPlatform

      • Terminated

      • DocumentName : Specify name of the Amazon Web Services Systems Manager document (SSM document) for which you want to see command execution results. For example, specify AWS-RunPatchBaseline to see command executions that used this SSM document to perform security patching operations on managed nodes.

      • ExecutionStage : Specify one of the following values (ListCommands operations only):

        • Executing : Returns a list of command executions that are currently still running.

        • Complete : Returns a list of command executions that have already completed.

rtype

dict

returns

Response Syntax

{
    'Commands': [
        {
            'CommandId': 'string',
            'DocumentName': 'string',
            'DocumentVersion': 'string',
            'Comment': 'string',
            'ExpiresAfter': datetime(2015, 1, 1),
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'InstanceIds': [
                'string',
            ],
            'Targets': [
                {
                    'Key': 'string',
                    'Values': [
                        'string',
                    ]
                },
            ],
            'RequestedDateTime': datetime(2015, 1, 1),
            'Status': 'Pending'|'InProgress'|'Success'|'Cancelled'|'Failed'|'TimedOut'|'Cancelling',
            'StatusDetails': 'string',
            'OutputS3Region': 'string',
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string',
            'MaxConcurrency': 'string',
            'MaxErrors': 'string',
            'TargetCount': 123,
            'CompletedCount': 123,
            'ErrorCount': 123,
            'DeliveryTimedOutCount': 123,
            'ServiceRole': 'string',
            'NotificationConfig': {
                'NotificationArn': 'string',
                'NotificationEvents': [
                    'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
                ],
                'NotificationType': 'Command'|'Invocation'
            },
            'CloudWatchOutputConfig': {
                'CloudWatchLogGroupName': 'string',
                'CloudWatchOutputEnabled': True|False
            },
            'TimeoutSeconds': 123,
            'AlarmConfiguration': {
                'IgnorePollAlarmFailure': True|False,
                'Alarms': [
                    {
                        'Name': 'string'
                    },
                ]
            },
            'TriggeredAlarms': [
                {
                    'Name': 'string',
                    'State': 'UNKNOWN'|'ALARM'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Commands (list) --

      (Optional) The list of commands requested by the user.

      • (dict) --

        Describes a command request.

        • CommandId (string) --

          A unique identifier for this command.

        • DocumentName (string) --

          The name of the document requested for execution.

        • DocumentVersion (string) --

          The Systems Manager document (SSM document) version.

        • Comment (string) --

          User-specified information about the command, such as a brief description of what the command should do.

        • ExpiresAfter (datetime) --

          If a command expires, it changes status to DeliveryTimedOut for all invocations that have the status InProgress , Pending , or Delayed . ExpiresAfter is calculated based on the total timeout for the overall command. For more information, see Understanding command timeout values in the Amazon Web Services Systems Manager User Guide .

        • Parameters (dict) --

          The parameter values to be inserted in the document when running the command.

          • (string) --

            • (list) --

              • (string) --

        • InstanceIds (list) --

          The managed node IDs against which this command was requested.

          • (string) --

        • Targets (list) --

          An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Targets is required if you don't provide one or more managed node IDs in the call.

          • (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) --

        • RequestedDateTime (datetime) --

          The date and time the command was requested.

        • Status (string) --

          The status of the command.

        • StatusDetails (string) --

          A detailed status of the command execution. StatusDetails includes more information than Status because it includes states resulting from error and concurrency control parameters. StatusDetails can show different results than Status. For more information about these statuses, see Understanding command statuses in the Amazon Web Services Systems Manager User Guide . StatusDetails can be one of the following values:

          • Pending: The command hasn't been sent to any managed nodes.

          • In Progress: The command has been sent to at least one managed node but hasn't reached a final state on all managed nodes.

          • Success: The command successfully ran on all invocations. This is a terminal state.

          • Delivery Timed Out: The value of MaxErrors or more command invocations shows a status of Delivery Timed Out. This is a terminal state.

          • Execution Timed Out: The value of MaxErrors or more command invocations shows a status of Execution Timed Out. This is a terminal state.

          • Failed: The value of MaxErrors or more command invocations shows a status of Failed. This is a terminal state.

          • Incomplete: The command was attempted on all managed nodes and one or more invocations doesn't have a value of Success but not enough invocations failed for the status to be Failed. This is a terminal state.

          • Cancelled: The command was terminated before it was completed. This is a terminal state.

          • Rate Exceeded: The number of managed nodes targeted by the command exceeded the account limit for pending invocations. The system has canceled the command before running it on any managed node. This is a terminal state.

          • Delayed: The system attempted to send the command to the managed node but wasn't successful. The system retries again.

        • OutputS3Region (string) --

          (Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

        • OutputS3BucketName (string) --

          The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.

        • OutputS3KeyPrefix (string) --

          The S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.

        • MaxConcurrency (string) --

          The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number of managed nodes, such as 10, or a percentage of nodes, such as 10%. The default value is 50. For more information about how to use MaxConcurrency , see Running commands using Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide .

        • MaxErrors (string) --

          The maximum number of errors allowed before the system stops sending the command to additional targets. You can specify a number of errors, such as 10, or a percentage or errors, such as 10%. The default value is 0 . For more information about how to use MaxErrors , see Running commands using Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide .

        • TargetCount (integer) --

          The number of targets for the command.

        • CompletedCount (integer) --

          The number of targets for which the command invocation reached a terminal state. Terminal states include the following: Success, Failed, Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or Undeliverable.

        • ErrorCount (integer) --

          The number of targets for which the status is Failed or Execution Timed Out.

        • DeliveryTimedOutCount (integer) --

          The number of targets for which the status is Delivery Timed Out.

        • ServiceRole (string) --

          The Identity and Access Management (IAM) service role that Run Command, a capability of Amazon Web Services Systems Manager, uses to act on your behalf when sending notifications about command status changes.

        • NotificationConfig (dict) --

          Configurations for sending notifications about command status changes.

          • NotificationArn (string) --

            An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

          • NotificationEvents (list) --

            The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

            • (string) --

          • NotificationType (string) --

            The type of notification.

            • Command : Receive notification when the status of a command changes.

            • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

        • CloudWatchOutputConfig (dict) --

          Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.

          • CloudWatchLogGroupName (string) --

            The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

            ``aws/ssm/SystemsManagerDocumentName ``

          • CloudWatchOutputEnabled (boolean) --

            Enables Systems Manager to send command output to CloudWatch Logs.

        • TimeoutSeconds (integer) --

          The TimeoutSeconds value specified for a command.

        • AlarmConfiguration (dict) --

          The details for the CloudWatch alarm applied to your 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 by the command.

          • (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) --

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

RegisterTaskWithMaintenanceWindow (updated) Link ¶
Changes (request)
{'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                        'IgnorePollAlarmFailure': 'boolean'}}

Adds a new task to a maintenance window.

See also: AWS API Documentation

Request Syntax

client.register_task_with_maintenance_window(
    WindowId='string',
    Targets=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    TaskArn='string',
    ServiceRoleArn='string',
    TaskType='RUN_COMMAND'|'AUTOMATION'|'STEP_FUNCTIONS'|'LAMBDA',
    TaskParameters={
        'string': {
            'Values': [
                'string',
            ]
        }
    },
    TaskInvocationParameters={
        'RunCommand': {
            'Comment': 'string',
            'CloudWatchOutputConfig': {
                'CloudWatchLogGroupName': 'string',
                'CloudWatchOutputEnabled': True|False
            },
            'DocumentHash': 'string',
            'DocumentHashType': 'Sha256'|'Sha1',
            'DocumentVersion': 'string',
            'NotificationConfig': {
                'NotificationArn': 'string',
                'NotificationEvents': [
                    'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
                ],
                'NotificationType': 'Command'|'Invocation'
            },
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'ServiceRoleArn': 'string',
            'TimeoutSeconds': 123
        },
        'Automation': {
            'DocumentVersion': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            }
        },
        'StepFunctions': {
            'Input': 'string',
            'Name': 'string'
        },
        'Lambda': {
            'ClientContext': 'string',
            'Qualifier': 'string',
            'Payload': b'bytes'
        }
    },
    Priority=123,
    MaxConcurrency='string',
    MaxErrors='string',
    LoggingInfo={
        'S3BucketName': 'string',
        'S3KeyPrefix': 'string',
        'S3Region': 'string'
    },
    Name='string',
    Description='string',
    ClientToken='string',
    CutoffBehavior='CONTINUE_TASK'|'CANCEL_TASK',
    AlarmConfiguration={
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
)
type WindowId

string

param WindowId

[REQUIRED]

The ID of the maintenance window the task should be added to.

type Targets

list

param Targets

The targets (either managed nodes or maintenance window targets).

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 .

Specify managed nodes using the following format:

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

Specify maintenance window targets using the following format:

Key=WindowTargetIds,Values=<window-target-id-1>,<window-target-id-2>

  • (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 TaskArn

string

param TaskArn

[REQUIRED]

The ARN of the task to run.

type ServiceRoleArn

string

param ServiceRoleArn

The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created when you run RegisterTaskWithMaintenanceWindow .

For more information, see the following topics in the in the Amazon Web Services Systems Manager User Guide :

type TaskType

string

param TaskType

[REQUIRED]

The type of task being registered.

type TaskParameters

dict

param TaskParameters

The parameters that should be passed to the task when it is run.

Note

TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

  • (string) --

    • (dict) --

      Defines the values for a task parameter.

      • Values (list) --

        This field contains an array of 0 or more strings, each 1 to 255 characters in length.

        • (string) --

type TaskInvocationParameters

dict

param TaskInvocationParameters

The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.

  • RunCommand (dict) --

    The parameters for a RUN_COMMAND task type.

    • Comment (string) --

      Information about the commands to run.

    • CloudWatchOutputConfig (dict) --

      Configuration options for sending command output to Amazon CloudWatch Logs.

      • CloudWatchLogGroupName (string) --

        The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

        ``aws/ssm/SystemsManagerDocumentName ``

      • CloudWatchOutputEnabled (boolean) --

        Enables Systems Manager to send command output to CloudWatch Logs.

    • DocumentHash (string) --

      The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.

    • DocumentHashType (string) --

      SHA-256 or SHA-1. SHA-1 hashes have been deprecated.

    • DocumentVersion (string) --

      The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify $DEFAULT , $LATEST , or a specific version number. If you run commands by using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

      --document-version "\$DEFAULT"

      --document-version "\$LATEST"

      --document-version "3"

    • NotificationConfig (dict) --

      Configurations for sending notifications about command status changes on a per-managed node basis.

      • NotificationArn (string) --

        An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

      • NotificationEvents (list) --

        The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

        • (string) --

      • NotificationType (string) --

        The type of notification.

        • Command : Receive notification when the status of a command changes.

        • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

    • OutputS3BucketName (string) --

      The name of the Amazon Simple Storage Service (Amazon S3) bucket.

    • OutputS3KeyPrefix (string) --

      The S3 bucket subfolder.

    • Parameters (dict) --

      The parameters for the RUN_COMMAND task execution.

      • (string) --

        • (list) --

          • (string) --

    • ServiceRoleArn (string) --

      The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

    • TimeoutSeconds (integer) --

      If this time is reached and the command hasn't already started running, it doesn't run.

  • Automation (dict) --

    The parameters for an AUTOMATION task type.

    • DocumentVersion (string) --

      The version of an Automation runbook to use during task execution.

    • Parameters (dict) --

      The parameters for the AUTOMATION task.

      For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask .

      Note

      LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      For AUTOMATION task types, Amazon Web Services Systems Manager ignores any values specified for these parameters.

      • (string) --

        • (list) --

          • (string) --

  • StepFunctions (dict) --

    The parameters for a STEP_FUNCTIONS task type.

    • Input (string) --

      The inputs for the STEP_FUNCTIONS task.

    • Name (string) --

      The name of the STEP_FUNCTIONS task.

  • Lambda (dict) --

    The parameters for a LAMBDA task type.

    • ClientContext (string) --

      Pass client-specific information to the Lambda function that you are invoking. You can then process the client information in your Lambda function as you choose through the context variable.

    • Qualifier (string) --

      (Optional) Specify an Lambda function version or alias name. If you specify a function version, the operation uses the qualified function Amazon Resource Name (ARN) to invoke a specific Lambda function. If you specify an alias name, the operation uses the alias ARN to invoke the Lambda function version to which the alias points.

    • Payload (bytes) --

      JSON to provide to your Lambda function as input.

type Priority

integer

param Priority

The priority of the task in the maintenance window, the lower the number the higher the priority. Tasks in a maintenance window are scheduled in priority order with tasks that have the same priority scheduled in parallel.

type MaxConcurrency

string

param MaxConcurrency

The maximum number of targets this task can be run for, in parallel.

Note

Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

type MaxErrors

string

param MaxErrors

The maximum number of errors allowed before this task stops being scheduled.

Note

Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

type LoggingInfo

dict

param LoggingInfo

A structure containing information about an Amazon Simple Storage Service (Amazon S3) bucket to write managed node-level logs to.

Note

LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

  • S3BucketName (string) -- [REQUIRED]

    The name of an S3 bucket where execution logs are stored .

  • S3KeyPrefix (string) --

    (Optional) The S3 bucket subfolder.

  • S3Region (string) -- [REQUIRED]

    The Amazon Web Services Region where the S3 bucket is located.

type Name

string

param Name

An optional name for the task.

type Description

string

param Description

An optional description for the task.

type ClientToken

string

param ClientToken

User-provided idempotency token.

This field is autopopulated if not provided.

type CutoffBehavior

string

param CutoffBehavior

Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

  • CONTINUE_TASK : When the cutoff time is reached, any tasks that are running continue. The default value.

  • CANCEL_TASK :

    • For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.

    • For Run Command tasks: When the cutoff time is reached, the system sends a CancelCommand operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.

The status for tasks that are not completed is TIMED_OUT .

type AlarmConfiguration

dict

param AlarmConfiguration

The CloudWatch alarm you want to apply to your maintenance window task.

  • 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

{
    'WindowTaskId': 'string'
}

Response Structure

  • (dict) --

    • WindowTaskId (string) --

      The ID of the task in the maintenance window.

SendCommand (updated) Link ¶
Changes (request, response)
Request
{'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                        'IgnorePollAlarmFailure': 'boolean'}}
Response
{'Command': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                    'IgnorePollAlarmFailure': 'boolean'},
             'TriggeredAlarms': [{'Name': 'string',
                                  'State': 'UNKNOWN | ALARM'}]}}

Runs commands on one or more managed nodes.

See also: AWS API Documentation

Request Syntax

client.send_command(
    InstanceIds=[
        'string',
    ],
    Targets=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    DocumentName='string',
    DocumentVersion='string',
    DocumentHash='string',
    DocumentHashType='Sha256'|'Sha1',
    TimeoutSeconds=123,
    Comment='string',
    Parameters={
        'string': [
            'string',
        ]
    },
    OutputS3Region='string',
    OutputS3BucketName='string',
    OutputS3KeyPrefix='string',
    MaxConcurrency='string',
    MaxErrors='string',
    ServiceRoleArn='string',
    NotificationConfig={
        'NotificationArn': 'string',
        'NotificationEvents': [
            'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
        ],
        'NotificationType': 'Command'|'Invocation'
    },
    CloudWatchOutputConfig={
        'CloudWatchLogGroupName': 'string',
        'CloudWatchOutputEnabled': True|False
    },
    AlarmConfiguration={
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
)
type InstanceIds

list

param InstanceIds

The IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs.

To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets , which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once.

For more information about how to use targets, see Using targets and rate controls to send commands to a fleet in the Amazon Web Services Systems Manager User Guide .

  • (string) --

type Targets

list

param Targets

An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets , which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once.

To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead.

For more information about how to use targets, see Sending commands to a fleet 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 DocumentName

string

param DocumentName

[REQUIRED]

The name of the Amazon Web Services Systems Manager document (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 Amazon Resource Name (ARN). For more information about how to use shared documents, see Using shared SSM documents in the Amazon Web Services Systems Manager User Guide .

Note

If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error.

type DocumentVersion

string

param DocumentVersion

The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

--document-version "$DEFAULT"

--document-version "$LATEST"

--document-version "3"

type DocumentHash

string

param DocumentHash

The Sha256 or Sha1 hash created by the system when the document was created.

Note

Sha1 hashes have been deprecated.

type DocumentHashType

string

param DocumentHashType

Sha256 or Sha1.

Note

Sha1 hashes have been deprecated.

type TimeoutSeconds

integer

param TimeoutSeconds

If this time is reached and the command hasn't already started running, it won't run.

type Comment

string

param Comment

User-specified information about the command, such as a brief description of what the command should do.

type Parameters

dict

param Parameters

The required and optional parameters specified in the document being run.

  • (string) --

    • (list) --

      • (string) --

type OutputS3Region

string

param OutputS3Region

(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

type OutputS3BucketName

string

param OutputS3BucketName

The name of the S3 bucket where command execution responses should be stored.

type OutputS3KeyPrefix

string

param OutputS3KeyPrefix

The directory structure within the S3 bucket where the responses should be stored.

type MaxConcurrency

string

param MaxConcurrency

(Optional) The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number such as 10 or a percentage such as 10%. The default value is 50 . For more information about how to use MaxConcurrency , see Using concurrency controls in the Amazon Web Services Systems Manager User Guide .

type MaxErrors

string

param MaxErrors

The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors , the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0 . For more information about how to use MaxErrors , see Using error controls in the Amazon Web Services Systems Manager User Guide .

type ServiceRoleArn

string

param ServiceRoleArn

The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands.

This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

type NotificationConfig

dict

param NotificationConfig

Configurations for sending notifications.

  • NotificationArn (string) --

    An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

  • NotificationEvents (list) --

    The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

    • (string) --

  • NotificationType (string) --

    The type of notification.

    • Command : Receive notification when the status of a command changes.

    • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

type CloudWatchOutputConfig

dict

param CloudWatchOutputConfig

Enables Amazon Web Services Systems Manager to send Run Command output to Amazon CloudWatch Logs. Run Command is a capability of Amazon Web Services Systems Manager.

  • CloudWatchLogGroupName (string) --

    The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

    ``aws/ssm/SystemsManagerDocumentName ``

  • CloudWatchOutputEnabled (boolean) --

    Enables Systems Manager to send command output to CloudWatch Logs.

type AlarmConfiguration

dict

param AlarmConfiguration

The CloudWatch alarm you want to apply to your 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

{
    'Command': {
        'CommandId': 'string',
        'DocumentName': 'string',
        'DocumentVersion': 'string',
        'Comment': 'string',
        'ExpiresAfter': datetime(2015, 1, 1),
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'InstanceIds': [
            'string',
        ],
        'Targets': [
            {
                'Key': 'string',
                'Values': [
                    'string',
                ]
            },
        ],
        'RequestedDateTime': datetime(2015, 1, 1),
        'Status': 'Pending'|'InProgress'|'Success'|'Cancelled'|'Failed'|'TimedOut'|'Cancelling',
        'StatusDetails': 'string',
        'OutputS3Region': 'string',
        'OutputS3BucketName': 'string',
        'OutputS3KeyPrefix': 'string',
        'MaxConcurrency': 'string',
        'MaxErrors': 'string',
        'TargetCount': 123,
        'CompletedCount': 123,
        'ErrorCount': 123,
        'DeliveryTimedOutCount': 123,
        'ServiceRole': 'string',
        'NotificationConfig': {
            'NotificationArn': 'string',
            'NotificationEvents': [
                'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
            ],
            'NotificationType': 'Command'|'Invocation'
        },
        'CloudWatchOutputConfig': {
            'CloudWatchLogGroupName': 'string',
            'CloudWatchOutputEnabled': True|False
        },
        'TimeoutSeconds': 123,
        'AlarmConfiguration': {
            'IgnorePollAlarmFailure': True|False,
            'Alarms': [
                {
                    'Name': 'string'
                },
            ]
        },
        'TriggeredAlarms': [
            {
                'Name': 'string',
                'State': 'UNKNOWN'|'ALARM'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • Command (dict) --

      The request as it was received by Systems Manager. Also provides the command ID which can be used future references to this request.

      • CommandId (string) --

        A unique identifier for this command.

      • DocumentName (string) --

        The name of the document requested for execution.

      • DocumentVersion (string) --

        The Systems Manager document (SSM document) version.

      • Comment (string) --

        User-specified information about the command, such as a brief description of what the command should do.

      • ExpiresAfter (datetime) --

        If a command expires, it changes status to DeliveryTimedOut for all invocations that have the status InProgress , Pending , or Delayed . ExpiresAfter is calculated based on the total timeout for the overall command. For more information, see Understanding command timeout values in the Amazon Web Services Systems Manager User Guide .

      • Parameters (dict) --

        The parameter values to be inserted in the document when running the command.

        • (string) --

          • (list) --

            • (string) --

      • InstanceIds (list) --

        The managed node IDs against which this command was requested.

        • (string) --

      • Targets (list) --

        An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Targets is required if you don't provide one or more managed node IDs in the call.

        • (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) --

      • RequestedDateTime (datetime) --

        The date and time the command was requested.

      • Status (string) --

        The status of the command.

      • StatusDetails (string) --

        A detailed status of the command execution. StatusDetails includes more information than Status because it includes states resulting from error and concurrency control parameters. StatusDetails can show different results than Status. For more information about these statuses, see Understanding command statuses in the Amazon Web Services Systems Manager User Guide . StatusDetails can be one of the following values:

        • Pending: The command hasn't been sent to any managed nodes.

        • In Progress: The command has been sent to at least one managed node but hasn't reached a final state on all managed nodes.

        • Success: The command successfully ran on all invocations. This is a terminal state.

        • Delivery Timed Out: The value of MaxErrors or more command invocations shows a status of Delivery Timed Out. This is a terminal state.

        • Execution Timed Out: The value of MaxErrors or more command invocations shows a status of Execution Timed Out. This is a terminal state.

        • Failed: The value of MaxErrors or more command invocations shows a status of Failed. This is a terminal state.

        • Incomplete: The command was attempted on all managed nodes and one or more invocations doesn't have a value of Success but not enough invocations failed for the status to be Failed. This is a terminal state.

        • Cancelled: The command was terminated before it was completed. This is a terminal state.

        • Rate Exceeded: The number of managed nodes targeted by the command exceeded the account limit for pending invocations. The system has canceled the command before running it on any managed node. This is a terminal state.

        • Delayed: The system attempted to send the command to the managed node but wasn't successful. The system retries again.

      • OutputS3Region (string) --

        (Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket.

      • OutputS3BucketName (string) --

        The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.

      • OutputS3KeyPrefix (string) --

        The S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.

      • MaxConcurrency (string) --

        The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number of managed nodes, such as 10, or a percentage of nodes, such as 10%. The default value is 50. For more information about how to use MaxConcurrency , see Running commands using Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide .

      • MaxErrors (string) --

        The maximum number of errors allowed before the system stops sending the command to additional targets. You can specify a number of errors, such as 10, or a percentage or errors, such as 10%. The default value is 0 . For more information about how to use MaxErrors , see Running commands using Systems Manager Run Command in the Amazon Web Services Systems Manager User Guide .

      • TargetCount (integer) --

        The number of targets for the command.

      • CompletedCount (integer) --

        The number of targets for which the command invocation reached a terminal state. Terminal states include the following: Success, Failed, Execution Timed Out, Delivery Timed Out, Cancelled, Terminated, or Undeliverable.

      • ErrorCount (integer) --

        The number of targets for which the status is Failed or Execution Timed Out.

      • DeliveryTimedOutCount (integer) --

        The number of targets for which the status is Delivery Timed Out.

      • ServiceRole (string) --

        The Identity and Access Management (IAM) service role that Run Command, a capability of Amazon Web Services Systems Manager, uses to act on your behalf when sending notifications about command status changes.

      • NotificationConfig (dict) --

        Configurations for sending notifications about command status changes.

        • NotificationArn (string) --

          An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

        • NotificationEvents (list) --

          The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

          • (string) --

        • NotificationType (string) --

          The type of notification.

          • Command : Receive notification when the status of a command changes.

          • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

      • CloudWatchOutputConfig (dict) --

        Amazon CloudWatch Logs information where you want Amazon Web Services Systems Manager to send the command output.

        • CloudWatchLogGroupName (string) --

          The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

          ``aws/ssm/SystemsManagerDocumentName ``

        • CloudWatchOutputEnabled (boolean) --

          Enables Systems Manager to send command output to CloudWatch Logs.

      • TimeoutSeconds (integer) --

        The TimeoutSeconds value specified for a command.

      • AlarmConfiguration (dict) --

        The details for the CloudWatch alarm applied to your 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 by the command.

        • (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.

StartAutomationExecution (updated) Link ¶
Changes (request)
{'AlarmConfiguration': {'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'
        },
    ],
    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 .

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.

UpdateAssociation (updated) Link ¶
Changes (request, response)
Request
{'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                        'IgnorePollAlarmFailure': 'boolean'}}
Response
{'AssociationDescription': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                   'IgnorePollAlarmFailure': 'boolean'},
                            'TriggeredAlarms': [{'Name': 'string',
                                                 'State': 'UNKNOWN | ALARM'}]}}

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'
        },
    ],
    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 .

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'
            },
        ],
        '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 .

      • 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': {'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                                                   'IgnorePollAlarmFailure': 'boolean'},
                            'TriggeredAlarms': [{'Name': 'string',
                                                 'State': 'UNKNOWN | ALARM'}]}}

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'
            },
        ],
        '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 .

      • 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.

UpdateMaintenanceWindowTask (updated) Link ¶
Changes (both)
{'AlarmConfiguration': {'Alarms': [{'Name': 'string'}],
                        'IgnorePollAlarmFailure': 'boolean'}}

Modifies a task assigned to a maintenance window. You can't change the task type, but you can change the following values:

  • TaskARN . For example, you can change a RUN_COMMAND task from AWS-RunPowerShellScript to AWS-RunShellScript .

  • ServiceRoleArn

  • TaskInvocationParameters

  • Priority

  • MaxConcurrency

  • MaxErrors

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 .

If the value for a parameter in UpdateMaintenanceWindowTask is null, then the corresponding field isn't modified. If you set Replace to true, then all fields required by the RegisterTaskWithMaintenanceWindow operation are required for this request. Optional fields that aren't specified are set to null.

Warning

When you update a maintenance window task that has options specified in TaskInvocationParameters , you must provide again all the TaskInvocationParameters values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified TaskInvocationParameters values for Comment , NotificationConfig , and OutputS3BucketName . If you update the maintenance window task and specify only a different OutputS3BucketName value, the values for Comment and NotificationConfig are removed.

See also: AWS API Documentation

Request Syntax

client.update_maintenance_window_task(
    WindowId='string',
    WindowTaskId='string',
    Targets=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    TaskArn='string',
    ServiceRoleArn='string',
    TaskParameters={
        'string': {
            'Values': [
                'string',
            ]
        }
    },
    TaskInvocationParameters={
        'RunCommand': {
            'Comment': 'string',
            'CloudWatchOutputConfig': {
                'CloudWatchLogGroupName': 'string',
                'CloudWatchOutputEnabled': True|False
            },
            'DocumentHash': 'string',
            'DocumentHashType': 'Sha256'|'Sha1',
            'DocumentVersion': 'string',
            'NotificationConfig': {
                'NotificationArn': 'string',
                'NotificationEvents': [
                    'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
                ],
                'NotificationType': 'Command'|'Invocation'
            },
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'ServiceRoleArn': 'string',
            'TimeoutSeconds': 123
        },
        'Automation': {
            'DocumentVersion': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            }
        },
        'StepFunctions': {
            'Input': 'string',
            'Name': 'string'
        },
        'Lambda': {
            'ClientContext': 'string',
            'Qualifier': 'string',
            'Payload': b'bytes'
        }
    },
    Priority=123,
    MaxConcurrency='string',
    MaxErrors='string',
    LoggingInfo={
        'S3BucketName': 'string',
        'S3KeyPrefix': 'string',
        'S3Region': 'string'
    },
    Name='string',
    Description='string',
    Replace=True|False,
    CutoffBehavior='CONTINUE_TASK'|'CANCEL_TASK',
    AlarmConfiguration={
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
)
type WindowId

string

param WindowId

[REQUIRED]

The maintenance window ID that contains the task to modify.

type WindowTaskId

string

param WindowTaskId

[REQUIRED]

The task ID to modify.

type Targets

list

param Targets

The targets (either managed nodes or tags) to modify. Managed nodes are specified using the format Key=instanceids,Values=instanceID_1,instanceID_2 . Tags are specified using the format Key=tag_name,Values=tag_value .

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 .

  • (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 TaskArn

string

param TaskArn

The task ARN to modify.

type ServiceRoleArn

string

param ServiceRoleArn

The Amazon Resource Name (ARN) of the IAM service role for Amazon Web Services Systems Manager to assume when running a maintenance window task. If you do not specify a service role ARN, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created when you run RegisterTaskWithMaintenanceWindow .

For more information, see the following topics in the in the Amazon Web Services Systems Manager User Guide :

type TaskParameters

dict

param TaskParameters

The parameters to modify.

Note

TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

The map has the following format:

Key: string, between 1 and 255 characters

Value: an array of strings, each string is between 1 and 255 characters

  • (string) --

    • (dict) --

      Defines the values for a task parameter.

      • Values (list) --

        This field contains an array of 0 or more strings, each 1 to 255 characters in length.

        • (string) --

type TaskInvocationParameters

dict

param TaskInvocationParameters

The parameters that the task should use during execution. Populate only the fields that match the task type. All other fields should be empty.

Warning

When you update a maintenance window task that has options specified in TaskInvocationParameters , you must provide again all the TaskInvocationParameters values that you want to retain. The values you don't specify again are removed. For example, suppose that when you registered a Run Command task, you specified TaskInvocationParameters values for Comment , NotificationConfig , and OutputS3BucketName . If you update the maintenance window task and specify only a different OutputS3BucketName value, the values for Comment and NotificationConfig are removed.

  • RunCommand (dict) --

    The parameters for a RUN_COMMAND task type.

    • Comment (string) --

      Information about the commands to run.

    • CloudWatchOutputConfig (dict) --

      Configuration options for sending command output to Amazon CloudWatch Logs.

      • CloudWatchLogGroupName (string) --

        The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

        ``aws/ssm/SystemsManagerDocumentName ``

      • CloudWatchOutputEnabled (boolean) --

        Enables Systems Manager to send command output to CloudWatch Logs.

    • DocumentHash (string) --

      The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.

    • DocumentHashType (string) --

      SHA-256 or SHA-1. SHA-1 hashes have been deprecated.

    • DocumentVersion (string) --

      The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify $DEFAULT , $LATEST , or a specific version number. If you run commands by using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

      --document-version "\$DEFAULT"

      --document-version "\$LATEST"

      --document-version "3"

    • NotificationConfig (dict) --

      Configurations for sending notifications about command status changes on a per-managed node basis.

      • NotificationArn (string) --

        An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

      • NotificationEvents (list) --

        The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

        • (string) --

      • NotificationType (string) --

        The type of notification.

        • Command : Receive notification when the status of a command changes.

        • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

    • OutputS3BucketName (string) --

      The name of the Amazon Simple Storage Service (Amazon S3) bucket.

    • OutputS3KeyPrefix (string) --

      The S3 bucket subfolder.

    • Parameters (dict) --

      The parameters for the RUN_COMMAND task execution.

      • (string) --

        • (list) --

          • (string) --

    • ServiceRoleArn (string) --

      The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

    • TimeoutSeconds (integer) --

      If this time is reached and the command hasn't already started running, it doesn't run.

  • Automation (dict) --

    The parameters for an AUTOMATION task type.

    • DocumentVersion (string) --

      The version of an Automation runbook to use during task execution.

    • Parameters (dict) --

      The parameters for the AUTOMATION task.

      For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask .

      Note

      LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      For AUTOMATION task types, Amazon Web Services Systems Manager ignores any values specified for these parameters.

      • (string) --

        • (list) --

          • (string) --

  • StepFunctions (dict) --

    The parameters for a STEP_FUNCTIONS task type.

    • Input (string) --

      The inputs for the STEP_FUNCTIONS task.

    • Name (string) --

      The name of the STEP_FUNCTIONS task.

  • Lambda (dict) --

    The parameters for a LAMBDA task type.

    • ClientContext (string) --

      Pass client-specific information to the Lambda function that you are invoking. You can then process the client information in your Lambda function as you choose through the context variable.

    • Qualifier (string) --

      (Optional) Specify an Lambda function version or alias name. If you specify a function version, the operation uses the qualified function Amazon Resource Name (ARN) to invoke a specific Lambda function. If you specify an alias name, the operation uses the alias ARN to invoke the Lambda function version to which the alias points.

    • Payload (bytes) --

      JSON to provide to your Lambda function as input.

type Priority

integer

param Priority

The new task priority to specify. The lower the number, the higher the priority. Tasks that have the same priority are scheduled in parallel.

type MaxConcurrency

string

param MaxConcurrency

The new MaxConcurrency value you want to specify. MaxConcurrency is the number of targets that are allowed to run this task, in parallel.

Note

Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

type MaxErrors

string

param MaxErrors

The new MaxErrors value to specify. MaxErrors is the maximum number of errors that are allowed before the task stops being scheduled.

Note

Although this element is listed as "Required: No", a value can be omitted only when you are registering or updating a targetless task You must provide a value in all other cases.

For maintenance window tasks without a target specified, you can't supply a value for this option. Instead, the system inserts a placeholder value of 1 . This value doesn't affect the running of your task.

type LoggingInfo

dict

param LoggingInfo

The new logging location in Amazon S3 to specify.

Note

LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

  • S3BucketName (string) -- [REQUIRED]

    The name of an S3 bucket where execution logs are stored .

  • S3KeyPrefix (string) --

    (Optional) The S3 bucket subfolder.

  • S3Region (string) -- [REQUIRED]

    The Amazon Web Services Region where the S3 bucket is located.

type Name

string

param Name

The new task name to specify.

type Description

string

param Description

The new task description to specify.

type Replace

boolean

param Replace

If True, then all fields that are required by the RegisterTaskWithMaintenanceWindow operation are also required for this API request. Optional fields that aren't specified are set to null.

type CutoffBehavior

string

param CutoffBehavior

Indicates whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

  • CONTINUE_TASK : When the cutoff time is reached, any tasks that are running continue. The default value.

  • CANCEL_TASK :

    • For Automation, Lambda, Step Functions tasks: When the cutoff time is reached, any task invocations that are already running continue, but no new task invocations are started.

    • For Run Command tasks: When the cutoff time is reached, the system sends a CancelCommand operation that attempts to cancel the command associated with the task. However, there is no guarantee that the command will be terminated and the underlying process stopped.

The status for tasks that are not completed is TIMED_OUT .

type AlarmConfiguration

dict

param AlarmConfiguration

The CloudWatch alarm you want to apply to your maintenance window task.

  • 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

{
    'WindowId': 'string',
    'WindowTaskId': 'string',
    'Targets': [
        {
            'Key': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    'TaskArn': 'string',
    'ServiceRoleArn': 'string',
    'TaskParameters': {
        'string': {
            'Values': [
                'string',
            ]
        }
    },
    'TaskInvocationParameters': {
        'RunCommand': {
            'Comment': 'string',
            'CloudWatchOutputConfig': {
                'CloudWatchLogGroupName': 'string',
                'CloudWatchOutputEnabled': True|False
            },
            'DocumentHash': 'string',
            'DocumentHashType': 'Sha256'|'Sha1',
            'DocumentVersion': 'string',
            'NotificationConfig': {
                'NotificationArn': 'string',
                'NotificationEvents': [
                    'All'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
                ],
                'NotificationType': 'Command'|'Invocation'
            },
            'OutputS3BucketName': 'string',
            'OutputS3KeyPrefix': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            },
            'ServiceRoleArn': 'string',
            'TimeoutSeconds': 123
        },
        'Automation': {
            'DocumentVersion': 'string',
            'Parameters': {
                'string': [
                    'string',
                ]
            }
        },
        'StepFunctions': {
            'Input': 'string',
            'Name': 'string'
        },
        'Lambda': {
            'ClientContext': 'string',
            'Qualifier': 'string',
            'Payload': b'bytes'
        }
    },
    'Priority': 123,
    'MaxConcurrency': 'string',
    'MaxErrors': 'string',
    'LoggingInfo': {
        'S3BucketName': 'string',
        'S3KeyPrefix': 'string',
        'S3Region': 'string'
    },
    'Name': 'string',
    'Description': 'string',
    'CutoffBehavior': 'CONTINUE_TASK'|'CANCEL_TASK',
    'AlarmConfiguration': {
        'IgnorePollAlarmFailure': True|False,
        'Alarms': [
            {
                'Name': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • WindowId (string) --

      The ID of the maintenance window that was updated.

    • WindowTaskId (string) --

      The task ID of the maintenance window that was updated.

    • Targets (list) --

      The updated target values.

      • (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) --

    • TaskArn (string) --

      The updated task ARN value.

    • ServiceRoleArn (string) --

      The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

    • TaskParameters (dict) --

      The updated parameter values.

      Note

      TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      • (string) --

        • (dict) --

          Defines the values for a task parameter.

          • Values (list) --

            This field contains an array of 0 or more strings, each 1 to 255 characters in length.

            • (string) --

    • TaskInvocationParameters (dict) --

      The updated parameter values.

      • RunCommand (dict) --

        The parameters for a RUN_COMMAND task type.

        • Comment (string) --

          Information about the commands to run.

        • CloudWatchOutputConfig (dict) --

          Configuration options for sending command output to Amazon CloudWatch Logs.

          • CloudWatchLogGroupName (string) --

            The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format:

            ``aws/ssm/SystemsManagerDocumentName ``

          • CloudWatchOutputEnabled (boolean) --

            Enables Systems Manager to send command output to CloudWatch Logs.

        • DocumentHash (string) --

          The SHA-256 or SHA-1 hash created by the system when the document was created. SHA-1 hashes have been deprecated.

        • DocumentHashType (string) --

          SHA-256 or SHA-1. SHA-1 hashes have been deprecated.

        • DocumentVersion (string) --

          The Amazon Web Services Systems Manager document (SSM document) version to use in the request. You can specify $DEFAULT , $LATEST , or a specific version number. If you run commands by using the Amazon Web Services CLI, then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example:

          --document-version "\$DEFAULT"

          --document-version "\$LATEST"

          --document-version "3"

        • NotificationConfig (dict) --

          Configurations for sending notifications about command status changes on a per-managed node basis.

          • NotificationArn (string) --

            An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic.

          • NotificationEvents (list) --

            The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide .

            • (string) --

          • NotificationType (string) --

            The type of notification.

            • Command : Receive notification when the status of a command changes.

            • Invocation : For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes.

        • OutputS3BucketName (string) --

          The name of the Amazon Simple Storage Service (Amazon S3) bucket.

        • OutputS3KeyPrefix (string) --

          The S3 bucket subfolder.

        • Parameters (dict) --

          The parameters for the RUN_COMMAND task execution.

          • (string) --

            • (list) --

              • (string) --

        • ServiceRoleArn (string) --

          The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for maintenance window Run Command tasks.

        • TimeoutSeconds (integer) --

          If this time is reached and the command hasn't already started running, it doesn't run.

      • Automation (dict) --

        The parameters for an AUTOMATION task type.

        • DocumentVersion (string) --

          The version of an Automation runbook to use during task execution.

        • Parameters (dict) --

          The parameters for the AUTOMATION task.

          For information about specifying and updating task parameters, see RegisterTaskWithMaintenanceWindow and UpdateMaintenanceWindowTask .

          Note

          LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

          TaskParameters has been deprecated. To specify parameters to pass to a task when it runs, instead use the Parameters option in the TaskInvocationParameters structure. For information about how Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

          For AUTOMATION task types, Amazon Web Services Systems Manager ignores any values specified for these parameters.

          • (string) --

            • (list) --

              • (string) --

      • StepFunctions (dict) --

        The parameters for a STEP_FUNCTIONS task type.

        • Input (string) --

          The inputs for the STEP_FUNCTIONS task.

        • Name (string) --

          The name of the STEP_FUNCTIONS task.

      • Lambda (dict) --

        The parameters for a LAMBDA task type.

        • ClientContext (string) --

          Pass client-specific information to the Lambda function that you are invoking. You can then process the client information in your Lambda function as you choose through the context variable.

        • Qualifier (string) --

          (Optional) Specify an Lambda function version or alias name. If you specify a function version, the operation uses the qualified function Amazon Resource Name (ARN) to invoke a specific Lambda function. If you specify an alias name, the operation uses the alias ARN to invoke the Lambda function version to which the alias points.

        • Payload (bytes) --

          JSON to provide to your Lambda function as input.

    • Priority (integer) --

      The updated priority value.

    • MaxConcurrency (string) --

      The updated MaxConcurrency value.

    • MaxErrors (string) --

      The updated MaxErrors value.

    • LoggingInfo (dict) --

      The updated logging information in Amazon S3.

      Note

      LoggingInfo has been deprecated. To specify an Amazon Simple Storage Service (Amazon S3) bucket to contain logs, instead use the OutputS3BucketName and OutputS3KeyPrefix options in the TaskInvocationParameters structure. For information about how Amazon Web Services Systems Manager handles these options for the supported maintenance window task types, see MaintenanceWindowTaskInvocationParameters .

      • S3BucketName (string) --

        The name of an S3 bucket where execution logs are stored .

      • S3KeyPrefix (string) --

        (Optional) The S3 bucket subfolder.

      • S3Region (string) --

        The Amazon Web Services Region where the S3 bucket is located.

    • Name (string) --

      The updated task name.

    • Description (string) --

      The updated task description.

    • CutoffBehavior (string) --

      The specification for whether tasks should continue to run after the cutoff time specified in the maintenance windows is reached.

    • AlarmConfiguration (dict) --

      The details for the CloudWatch alarm you applied to your maintenance window task.

      • 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.