1import type * as elbv2 from "@distilled.cloud/aws/elastic-load-balancing-v2";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { TargetGroup } from "./TargetGroup.ts";
5
6/**
7 * `RegisterTargets` request with `TargetGroupArn` injected from the bound
8 * {@link TargetGroup}.
9 */
10export interface RegisterTargetsRequest extends Omit<
11 elbv2.RegisterTargetsInput,
12 "TargetGroupArn"
13> {}
14
15/**
16 * Runtime binding for the `RegisterTargets` operation (IAM action
17 * `elasticloadbalancing:RegisterTargets` scoped to the target-group ARN).
18 *
19 * Registers targets (instances, IPs, Lambda functions, or an ALB) with the
20 * bound target group at runtime — e.g. custom blue/green orchestration, or
21 * compute that registers itself into a target group at boot.
22 * Provide the implementation with
23 * `Effect.provide(AWS.ELBv2.RegisterTargetsHttp)`.
24 * ### Dynamic Target Management
25 * **Example:** Register an IP target
26 * ```typescript
27 * // init — bind the operation to the target group
28 * const registerTargets = yield* AWS.ELBv2.RegisterTargets(targetGroup);
29 *
30 * // runtime — register a target by IP and port
31 * yield* registerTargets({
32 * Targets: [{ Id: "10.0.1.15", Port: 8080 }],
33 * });
34 * ```
35 *
36 * @binding
37 */
38export interface RegisterTargets extends Binding.Service<
39 RegisterTargets,
40 "AWS.ELBv2.RegisterTargets",
41 (
42 targetGroup: TargetGroup,
43 ) => Effect.Effect<
44 (
45 request: RegisterTargetsRequest,
46 ) => Effect.Effect<elbv2.RegisterTargetsOutput, elbv2.RegisterTargetsError>
47 >
48> {}
49
50export const RegisterTargets = Binding.Service<RegisterTargets>(
51 "AWS.ELBv2.RegisterTargets",
52);