| 1 | import type * as vpclattice from "@distilled.cloud/aws/vpc-lattice"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { TargetGroup } from "./TargetGroup.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `ListTargets` request with `targetGroupIdentifier` injected from the bound |
| 8 | * {@link TargetGroup}. |
| 9 | */ |
| 10 | export interface ListTargetsRequest extends Omit< |
| 11 | vpclattice.ListTargetsRequest, |
| 12 | "targetGroupIdentifier" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `ListTargets` operation (IAM action |
| 17 | * `vpc-lattice:ListTargets` on the target group ARN). |
| 18 | * |
| 19 | * Lists the bound {@link TargetGroup}'s registered targets with their health |
| 20 | * status — useful for health dashboards and for compute that verifies its own |
| 21 | * registration. Provide the implementation with |
| 22 | * `Effect.provide(AWS.VpcLattice.ListTargetsHttp)`. |
| 23 | * ### Managing Targets at Runtime |
| 24 | * **Example:** List the target group's targets |
| 25 | * ```typescript |
| 26 | * const listTargets = yield* AWS.VpcLattice.ListTargets(targetGroup); |
| 27 | * |
| 28 | * const { items } = yield* listTargets({}); |
| 29 | * for (const target of items) { |
| 30 | * yield* Effect.log(`${target.id}: ${target.status}`); |
| 31 | * } |
| 32 | * ``` |
| 33 | * |
| 34 | * @binding |
| 35 | */ |
| 36 | export interface ListTargets extends Binding.Service< |
| 37 | ListTargets, |
| 38 | "AWS.VpcLattice.ListTargets", |
| 39 | ( |
| 40 | targetGroup: TargetGroup, |
| 41 | ) => Effect.Effect< |
| 42 | ( |
| 43 | request: ListTargetsRequest, |
| 44 | ) => Effect.Effect< |
| 45 | vpclattice.ListTargetsResponse, |
| 46 | vpclattice.ListTargetsError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const ListTargets = Binding.Service<ListTargets>( |
| 51 | "AWS.VpcLattice.ListTargets", |
| 52 | ); |