Skip to content

describe_association

describe_association(
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    name: Optional[DocumentARN] = None,
    instance_id: Optional[InstanceId] = None,
    association_id: Optional[AssociationId] = None,
    association_version: Optional[AssociationVersion] = None,
) -> DescribeAssociationResult

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.

Parameters:

  • name (Optional[DocumentARN], default: None ) –

    The name of the SSM document.

  • instance_id (Optional[InstanceId], default: None ) –

    The managed node ID.

  • association_id (Optional[AssociationId], default: None ) –

    The association ID for which you want information.

  • association_version (Optional[AssociationVersion], default: None ) –

    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.

Raises:

  • AssociationDoesNotExist –

    The specified association doesn't exist.

  • InternalServerError –

    An error occurred on the server side.

  • InvalidAssociationVersion –

    The version you specified isn't valid. Use ListAssociationVersions to view all versions of an association according to the association ID. Or, use the $LATEST parameter to view the latest version of the association.

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

  • UnknownServiceError –

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

Source code in docs_src/capo_ssm/_services/ssm.py
def describe_association(
    self,
    *,
    config_overrides: Optional[SSMClientConfig] = None,
    name: Optional["capo_ssm.types.document_arn.DocumentARN"] = None,
    instance_id: Optional["capo_ssm.types.instance_id.InstanceId"] = None,
    association_id: Optional["capo_ssm.types.association_id.AssociationId"] = None,
    association_version: Optional[
        "capo_ssm.types.association_version.AssociationVersion"
    ] = None,
) -> "capo_ssm.types.describe_association_result.DescribeAssociationResult":
    """<p>Describes the association for the specified target or managed node. If you created the association by using the <code>Targets</code> parameter, then you must retrieve the association by using the association ID.</p>

    Args:
        name: <p>The name of the SSM document.</p>
        instance_id: <p>The managed node ID.</p>
        association_id: <p>The association ID for which you want information.</p>
        association_version: <p>Specify the association version to retrieve. To view the latest version, either specify <code>$LATEST</code> for this parameter, or omit this parameter. To view a list of all associations for a managed node, use <a>ListAssociations</a>. To get a list of versions for a specific association, use <a>ListAssociationVersions</a>. </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_association_version.InvalidAssociationVersion: <p>The version you specified isn't valid. Use ListAssociationVersions to view all versions of an association according to the association ID. Or, use the <code>$LATEST</code> parameter to view the latest version of the association.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ssm.types.describe_association_request.DescribeAssociationRequest]",
    ) -> OperationResponse[
        "capo_ssm.types.describe_association_result.DescribeAssociationResult"
    ]:
        import capo_ssm._operations.amazon_ssm.describe_association

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

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

        return capo_ssm.types.describe_association_result.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeAssociation", redact_output=_redact_output),
    )
    input_: capo_ssm.types.describe_association_request.DescribeAssociationRequest = {}
    if name is not None:
        input_["name"] = name
    if instance_id is not None:
        input_["instance_id"] = instance_id
    if association_id is not None:
        input_["association_id"] = association_id
    if association_version is not None:
        input_["association_version"] = association_version

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