describeTargetHealth
abstract suspend fun describeTargetHealth(input: DescribeTargetHealthRequest): DescribeTargetHealthResponse
Describes the health of the specified targets or all of your targets.
Samples
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.TargetDescription
fun main() {
//sampleStart
// This example describes the health of the targets for the specified target group. One target is
// healthy but the other is not specified in an action, so it can t receive traffic from the load balancer.
val resp = elasticLoadBalancingV2Client.describeTargetHealth {
targetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
}
//sampleEnd
}
import aws.sdk.kotlin.services.elasticloadbalancingv2.model.TargetDescription
fun main() {
//sampleStart
// This example describes the health of the specified target. This target is healthy.
val resp = elasticLoadBalancingV2Client.describeTargetHealth {
targetGroupArn = "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
targets = listOf<TargetDescription>(
TargetDescription {
id = "i-0f76fade"
port = 80
}
)
}
//sampleEnd
}