| 1 | import type * as ga from "@distilled.cloud/aws/global-accelerator"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { EndpointGroup } from "./EndpointGroup.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `globalaccelerator:AddEndpoints`. |
| 8 | * |
| 9 | * Registers additional endpoints (ALB/NLB ARNs, EC2 instance IDs, or Elastic |
| 10 | * IP allocation IDs) on the bound {@link EndpointGroup} at runtime — the |
| 11 | * dynamic-scaling counterpart to declaring `endpoints` in the resource |
| 12 | * props. Unlike a full `UpdateEndpointGroup`, adding endpoints does not |
| 13 | * touch the group's other endpoints or its health-check configuration. The |
| 14 | * endpoint group ARN is injected from the binding. Provide the |
| 15 | * implementation with |
| 16 | * `Effect.provide(AWS.GlobalAccelerator.AddEndpointsHttp)`. |
| 17 | * ### Managing Endpoints |
| 18 | * **Example:** Register an Endpoint Dynamically |
| 19 | * ```typescript |
| 20 | * // init — bind the operation to the endpoint group |
| 21 | * const addEndpoints = yield* AWS.GlobalAccelerator.AddEndpoints(group); |
| 22 | * |
| 23 | * // runtime |
| 24 | * yield* addEndpoints({ |
| 25 | * EndpointConfigurations: [{ EndpointId: allocationId, Weight: 128 }], |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface AddEndpoints extends Binding.Service< |
| 32 | AddEndpoints, |
| 33 | "AWS.GlobalAccelerator.AddEndpoints", |
| 34 | ( |
| 35 | endpointGroup: EndpointGroup, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: Omit<ga.AddEndpointsRequest, "EndpointGroupArn">, |
| 39 | ) => Effect.Effect<ga.AddEndpointsResponse, ga.AddEndpointsError> |
| 40 | > |
| 41 | > {} |
| 42 | export const AddEndpoints = Binding.Service<AddEndpoints>( |
| 43 | "AWS.GlobalAccelerator.AddEndpoints", |
| 44 | ); |