Skip to content

DescribeTargetHealth

Source: src/AWS/ELBv2/DescribeTargetHealth.ts

Runtime binding for the DescribeTargetHealth operation (IAM action elasticloadbalancing:DescribeTargetHealth; ELBv2 Describe* actions do not support resource-level permissions, so the grant is on *).

Reads the live health state of the bound target group’s targets — e.g. a readiness gate that waits for a freshly registered target to turn healthy before shifting traffic, or an ops endpoint surfacing fleet health. Provide the implementation with Effect.provide(AWS.ELBv2.DescribeTargetHealthHttp).

// init — bind the operation to the target group
const describeTargetHealth = yield* AWS.ELBv2.DescribeTargetHealth(targetGroup);
// runtime — read health states
const health = yield* describeTargetHealth({});
const states = health.TargetHealthDescriptions?.map(
(d) => d.TargetHealth?.State,
);