Amazon Simple Systems Manager (SSM)

2020/11/09 - Amazon Simple Systems Manager (SSM) - 1 updated api methods

Changes  add a new filter to allow customer to filter automation executions by using resource-group which used for execute automation

DescribeAutomationExecutions (updated) Link ΒΆ
Changes (request)
{'Filters': {'Key': {'TargetResourceGroup'}}}

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',
            '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. Valid filter keys include the following: DocumentNamePrefix, ExecutionStatus, ExecutionId, ParentExecutionId, CurrentAction, StartTimeBefore, StartTimeAfter, TargetResourceGroup.

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

          • (string) --

            • (list) --

              • (string) --

        • Mode (string) --

          The Automation execution mode.

        • ParentAutomationExecutionId (string) --

          The ExecutionId 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 document.

        • TargetParameterName (string) --

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

        • Targets (list) --

          The targets defined by the user when starting the Automation.

          • (dict) --

            An array of search criteria that targets instances using a Key,Value combination that you specify.

            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 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 AWS Region where the association was created.

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

            • Key (string) --

              User-defined criteria for sending commands that target instances 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 .

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

        • AutomationType (string) --

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

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