Amazon Simple Systems Manager (SSM)

2017/05/15 - Amazon Simple Systems Manager (SSM) - 2 updated api methods

Changes  UpdateAssociation API now supports updating document name and targets of an association. GetAutomationExecution API can return FailureDetails as an optional field to the StepExecution Object, which contains failure type, failure stage as well as other failure related information for a failed step.

GetAutomationExecution (updated) Link ¶
Changes (response)
{'AutomationExecution': {'StepExecutions': {'FailureDetails': {'Details': {'string': ['string']},
                                                               'FailureStage': 'string',
                                                               'FailureType': 'string'}}}}

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 document 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'|'Success'|'TimedOut'|'Cancelled'|'Failed',
        'StepExecutions': [
            {
                'StepName': 'string',
                'Action': 'string',
                'ExecutionStartTime': datetime(2015, 1, 1),
                'ExecutionEndTime': datetime(2015, 1, 1),
                'StepStatus': 'Pending'|'InProgress'|'Success'|'TimedOut'|'Cancelled'|'Failed',
                'ResponseCode': 'string',
                'Inputs': {
                    'string': 'string'
                },
                'Outputs': {
                    'string': [
                        'string',
                    ]
                },
                'Response': 'string',
                'FailureMessage': 'string',
                'FailureDetails': {
                    'FailureStage': 'string',
                    'FailureType': 'string',
                    'Details': {
                        'string': [
                            'string',
                        ]
                    }
                }
            },
        ],
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'Outputs': {
            'string': [
                'string',
            ]
        },
        'FailureMessage': '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 document 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 document contains a list of steps that are executed 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.

          • ExecutionStartTime (datetime) --

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

          • ExecutionEndTime (datetime) --

            If a step has finished execution, this contains the time the execution ended. If the step has not yet concluded, this field is not populated.

          • StepStatus (string) --

            The execution status for this step. Valid values include: Pending, InProgress, Success, Cancelled, Failed, and TimedOut.

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

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

        • (string) --

          • (list) --

            • (string) --

      • FailureMessage (string) --

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

UpdateAssociation (updated) Link ¶
Changes (request)
{'Name': 'string', 'Targets': [{'Key': 'string', 'Values': ['string']}]}

Updates an association. You can only update the document version, schedule, parameters, and Amazon S3 output of an association.

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

type ScheduleExpression

string

param ScheduleExpression

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

type OutputLocation

dict

param OutputLocation

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

  • S3Location (dict) --

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

    • OutputS3Region (string) --

      The Amazon S3 region where the association information is stored.

    • OutputS3BucketName (string) --

      The name of the Amazon S3 bucket.

    • OutputS3KeyPrefix (string) --

      The Amazon S3 bucket subfolder.

type Name

string

param Name

The name of the association document.

type Targets

list

param Targets

The targets of the association.

  • (dict) --

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

    • Key (string) --

      User-defined criteria for sending commands that target instances that meet the criteria. Key can be tag:<Amazon EC2 tag> or InstanceIds. For more information about how to send commands that target instances using Key,Value parameters, see Executing a Command Using Systems Manager Run Command.

    • Values (list) --

      User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to execute a command on instances that include Amazon EC2 tags of ServerRole,WebServer. For more information about how to send commands that target instances using Key,Value parameters, see Executing a Command Using Systems Manager Run Command.

      • (string) --

rtype

dict

returns

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': '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',
        '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)
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      The description of the association that was updated.

      • Name (string) --

        The name of the SSM document.

      • InstanceId (string) --

        The ID of the instance.

      • 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 instances, and one of them was successful, this would return the count of instances by status.

          • (string) --

            • (integer) --

      • DocumentVersion (string) --

        The document version.

      • Parameters (dict) --

        A description of the parameters for a document.

        • (string) --

          • (list) --

            • (string) --

      • AssociationId (string) --

        The association ID.

      • Targets (list) --

        The instances targeted by the request.

        • (dict) --

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

          • Key (string) --

            User-defined criteria for sending commands that target instances that meet the criteria. Key can be tag:<Amazon EC2 tag> or InstanceIds. For more information about how to send commands that target instances using Key,Value parameters, see Executing a Command Using Systems Manager Run Command.

          • Values (list) --

            User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to execute a command on instances that include Amazon EC2 tags of ServerRole,WebServer. For more information about how to send commands that target instances using Key,Value parameters, see Executing a Command Using Systems Manager Run Command.

            • (string) --

      • ScheduleExpression (string) --

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

      • OutputLocation (dict) --

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

        • S3Location (dict) --

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

          • OutputS3Region (string) --

            The Amazon S3 region where the association information is stored.

          • OutputS3BucketName (string) --

            The name of the Amazon S3 bucket.

          • OutputS3KeyPrefix (string) --

            The Amazon 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.