Skip to content

disassociate_application_status_check async

disassociate_application_status_check(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    application_status_check_id: Optional[ApplicationStatusCheckId] = None,
    target_tag_associations: Optional[CustomKeyValuePairRequestSet] = None,
    instance_ids: Optional[InstanceIdList] = None,
    client_token: Optional[String] = None,
    dry_run: Optional[Boolean] = None,
) -> DisassociateApplicationStatusCheckResult

Disassociates an application status check from instances or tags. After disassociation, health monitoring stops for the affected instances. The following rules apply:

  • You must specify either TargetTagAssociations or InstanceIds, but not both. Specifying both results in an InvalidParameterCombination error.

  • The application status check must already exist and belong to your account.

  • Tag keys must not be blank.

Parameters:

  • application_status_check_id (Optional[ApplicationStatusCheckId], default: None ) –

    The ID of the application status check to disassociate.

  • target_tag_associations (Optional[CustomKeyValuePairRequestSet], default: None ) –

    The tags to disassociate from the application status check. Specify the same key-value pairs that were used during association.

  • instance_ids (Optional[InstanceIdList], default: None ) –

    The IDs of the instances to disassociate from the application status check.

  • client_token (Optional[String], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same token, the service ignores the request but does not return an error. For more information, see Ensuring idempotency.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Raises:

Examples:

To disassociate an application status check from tags This example disassociates an application status check from instances matching the specified tag.

>>> await client.disassociate_application_status_check(application_status_check_id='asc-0123456789abcdef0', target_tag_associations=[{'Key': 'env', 'Value': 'prod'}])
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def disassociate_application_status_check(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    application_status_check_id: Optional[
        "capo_ec2.types.application_status_check_id.ApplicationStatusCheckId"
    ] = None,
    target_tag_associations: Optional[
        "capo_ec2.types.custom_key_value_pair_request_set.CustomKeyValuePairRequestSet"
    ] = None,
    instance_ids: Optional["capo_ec2.types.instance_id_list.InstanceIdList"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.disassociate_application_status_check_result.DisassociateApplicationStatusCheckResult":
    """<p>Disassociates an application status check from instances or <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">tags</a>. After disassociation, health monitoring stops for the affected instances. The following rules apply:</p> <ul> <li> <p>You must specify either <code>TargetTagAssociations</code> or <code>InstanceIds</code>, but not both. Specifying both results in an <code>InvalidParameterCombination</code> error.</p> </li> <li> <p>The application status check must already exist and belong to your account.</p> </li> <li> <p>Tag keys must not be blank.</p> </li> </ul>

    Args:
        application_status_check_id: <p>The ID of the application status check to disassociate.</p>
        target_tag_associations: <p>The <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html">tags</a> to disassociate from the application status check. Specify the same key-value pairs that were used during association.</p>
        instance_ids: <p>The IDs of the instances to disassociate from the application status check.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same token, the service ignores the request but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
        dry_run: <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To disassociate an application status check from tags
        This example disassociates an application status check from instances matching the specified tag.

        >>> await client.disassociate_application_status_check(application_status_check_id='asc-0123456789abcdef0', target_tag_associations=[{'Key': 'env', 'Value': 'prod'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.disassociate_application_status_check_request.DisassociateApplicationStatusCheckRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.disassociate_application_status_check_result.DisassociateApplicationStatusCheckResult"
    ]:
        import capo_ec2._operations.amazon_ec2.disassociate_application_status_check

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.disassociate_application_status_check.async_disassociate_application_status_check(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateApplicationStatusCheck")
    )
    input_: capo_ec2.types.disassociate_application_status_check_request.DisassociateApplicationStatusCheckRequest = {}
    if application_status_check_id is not None:
        input_["application_status_check_id"] = application_status_check_id
    if target_tag_associations is not None:
        input_["target_tag_associations"] = target_tag_associations
    if instance_ids is not None:
        input_["instance_ids"] = instance_ids
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output