Skip to content

update_association_status

update_association_status(
    name: DocumentARN,
    instance_id: InstanceId,
    association_status: AssociationStatus,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
) -> UpdateAssociationStatusResult

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.

Parameters:

Raises:

  • AssociationDoesNotExist –

    The specified association doesn't exist.

  • InternalServerError –

    An error occurred on the server side.

  • InvalidDocument –

    The specified SSM document doesn't exist.

  • InvalidInstanceId –

    The following problems can cause this exception:

    • You don't have permission to access the managed node.

    • Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.

    • SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.

    • The managed node isn't in a valid state. Valid states are: Running, Pending, Stopped, and Stopping. Invalid states are: Shutting-down and Terminated.

  • StatusUnchanged –

    The updated status is the same as the current status.

  • TooManyUpdates –

    There are concurrent updates for a resource that supports one update at a time.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_ssm/_services/ssm.py
def update_association_status(
    self,
    name: "capo_ssm.types.document_arn.DocumentARN",
    instance_id: "capo_ssm.types.instance_id.InstanceId",
    association_status: "capo_ssm.types.association_status.AssociationStatus",
    *,
    config_overrides: Optional[SSMClientConfig] = None,
) -> (
    "capo_ssm.types.update_association_status_result.UpdateAssociationStatusResult"
):
    """<p>Updates the status of the Amazon Web Services Systems Manager document (SSM document) associated with the specified managed node.</p> <p> <code>UpdateAssociationStatus</code> 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 <code>InstanceId</code> legacy parameter.</p>

    Args:
        name: <p>The name of the SSM document.</p>
        instance_id: <p>The managed node ID.</p>
        association_status: <p>The association status.</p>

    Raises:
        capo_ssm.errors.association_does_not_exist.AssociationDoesNotExist: <p>The specified association doesn't exist.</p>
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_document.InvalidDocument: <p>The specified SSM document doesn't exist.</p>
        capo_ssm.errors.invalid_instance_id.InvalidInstanceId: <p>The following problems can cause this exception:</p> <ul> <li> <p>You don't have permission to access the managed node.</p> </li> <li> <p>Amazon Web Services Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.</p> </li> <li> <p>SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.</p> </li> <li> <p>The managed node isn't in a valid state. Valid states are: <code>Running</code>, <code>Pending</code>, <code>Stopped</code>, and <code>Stopping</code>. Invalid states are: <code>Shutting-down</code> and <code>Terminated</code>.</p> </li> </ul>
        capo_ssm.errors.status_unchanged.StatusUnchanged: <p>The updated status is the same as the current status.</p>
        capo_ssm.errors.too_many_updates.TooManyUpdates: <p>There are concurrent updates for a resource that supports one update at a time.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.update_association_status_request.UpdateAssociationStatusRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.update_association_status_result.UpdateAssociationStatusResult"
    ]:
        import capo_ssm._operations.amazon_ssm.update_association_status

        output, http_response = (
            capo_ssm._operations.amazon_ssm.update_association_status.update_association_status(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_ssm.types.update_association_status_result.UpdateAssociationStatusResult",
    ) -> dict[str, Any]:
        import capo_ssm.types.update_association_status_result

        return capo_ssm.types.update_association_status_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateAssociationStatus", redact_output=_redact_output),
    )
    input_: capo_ssm.types.update_association_status_request.UpdateAssociationStatusRequest = {
        "name": name,
        "instance_id": instance_id,
        "association_status": association_status,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output