Skip to content

delete_health_check

delete_health_check(
    health_check_id: HealthCheckId,
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
) -> DeleteHealthCheckResponse

Deletes a health check.

Amazon Route 53 does not prevent you from deleting a health check even if the health check is associated with one or more resource record sets. If you delete a health check and you don't update the associated resource record sets, the future status of the health check can't be predicted and may change. This will affect the routing of DNS queries for your DNS failover configuration. For more information, see Replacing and Deleting Health Checks in the Amazon Route 53 Developer Guide.

If you're using Cloud Map and you configured Cloud Map to create a Route 53 health check when you register an instance, you can't use the Route 53 DeleteHealthCheck command to delete the health check. The health check is deleted automatically when you deregister the instance; there can be a delay of several hours before the health check is deleted from Route 53.

Parameters:

  • health_check_id (HealthCheckId) –

    The ID of the health check that you want to delete.

Raises:

Source code in docs_src/capo_route_53/_services/route53.py
def delete_health_check(
    self,
    health_check_id: "capo_route_53.types.health_check_id.HealthCheckId",
    *,
    config_overrides: Optional[Route53ClientConfig] = None,
) -> "capo_route_53.types.delete_health_check_response.DeleteHealthCheckResponse":
    """<p>Deletes a health check.</p> <important> <p>Amazon Route 53 does not prevent you from deleting a health check even if the health check is associated with one or more resource record sets. If you delete a health check and you don't update the associated resource record sets, the future status of the health check can't be predicted and may change. This will affect the routing of DNS queries for your DNS failover configuration. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating-deleting.html#health-checks-deleting.html">Replacing and Deleting Health Checks</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> </important> <p>If you're using Cloud Map and you configured Cloud Map to create a Route 53 health check when you register an instance, you can't use the Route 53 <code>DeleteHealthCheck</code> command to delete the health check. The health check is deleted automatically when you deregister the instance; there can be a delay of several hours before the health check is deleted from Route 53. </p>

    Args:
        health_check_id: <p>The ID of the health check that you want to delete.</p>

    Raises:
        capo_route_53.errors.health_check_in_use.HealthCheckInUse: <p>This error code is not in use.</p>
        capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
        capo_route_53.errors.no_such_health_check.NoSuchHealthCheck: <p>No health check exists with the specified ID.</p>
        capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route_53.types.delete_health_check_request.DeleteHealthCheckRequest]",
    ) -> OperationResponse[
        "capo_route_53.types.delete_health_check_response.DeleteHealthCheckResponse"
    ]:
        import capo_route_53._operations.aws_dns_v20130401.delete_health_check

        output, http_response = (
            capo_route_53._operations.aws_dns_v20130401.delete_health_check.delete_health_check(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteHealthCheck")
    )
    input_: capo_route_53.types.delete_health_check_request.DeleteHealthCheckRequest = {
        "health_check_id": health_check_id
    }

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