| 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 | * `RegisterTargets` request with `targetGroupIdentifier` injected from the |
| 8 | * bound {@link TargetGroup}. |
| 9 | */ |
| 10 | export interface RegisterTargetsRequest extends Omit< |
| 11 | vpclattice.RegisterTargetsRequest, |
| 12 | "targetGroupIdentifier" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `RegisterTargets` operation (IAM action |
| 17 | * `vpc-lattice:RegisterTargets` on the target group ARN). |
| 18 | * |
| 19 | * Registers targets with the bound {@link TargetGroup} at runtime — the |
| 20 | * self-registration data plane for workloads that join a lattice service |
| 21 | * dynamically. Provide the implementation with |
| 22 | * `Effect.provide(AWS.VpcLattice.RegisterTargetsHttp)`. |
| 23 | * ### Managing Targets at Runtime |
| 24 | * **Example:** Register a target |
| 25 | * ```typescript |
| 26 | * const registerTargets = yield* AWS.VpcLattice.RegisterTargets(targetGroup); |
| 27 | * |
| 28 | * const { successful, unsuccessful } = yield* registerTargets({ |
| 29 | * targets: [{ id: "10.0.1.10", port: 80 }], |
| 30 | * }); |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface RegisterTargets extends Binding.Service< |
| 36 | RegisterTargets, |
| 37 | "AWS.VpcLattice.RegisterTargets", |
| 38 | ( |
| 39 | targetGroup: TargetGroup, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request: RegisterTargetsRequest, |
| 43 | ) => Effect.Effect< |
| 44 | vpclattice.RegisterTargetsResponse, |
| 45 | vpclattice.RegisterTargetsError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | export const RegisterTargets = Binding.Service<RegisterTargets>( |
| 50 | "AWS.VpcLattice.RegisterTargets", |
| 51 | ); |