updateInstanceCustomHealthStatus
inline suspend fun ServiceDiscoveryClient.updateInstanceCustomHealthStatus(crossinline block: UpdateInstanceCustomHealthStatusRequest.Builder.() -> Unit): UpdateInstanceCustomHealthStatusResponse
Submits a request to change the health status of a custom health check to healthy or unhealthy.
You can use UpdateInstanceCustomHealthStatus
to change the status only for custom health checks, which you define using HealthCheckCustomConfig
when you create a service. You can't use it to change the status for Route 53 health checks, which you define using HealthCheckConfig
.
For more information, see HealthCheckCustomConfig.
Samples
fun main() {
//sampleStart
// This example submits a request to change the health status of an instance associated with a service
// with a custom health check to HEALTHY.
serviceDiscoveryClient.updateInstanceCustomHealthStatus {
instanceId = "i-abcd1234"
serviceId = "srv-e4anhexample0004"
status = CustomHealthStatus.fromValue("HEALTHY")
}
//sampleEnd
}