| 1 | import type * as r53r from "@distilled.cloud/aws/route53resolver"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { ResolverEndpoint } from "./ResolverEndpoint.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `route53resolver:GetResolverEndpoint` — read the bound |
| 8 | * {@link ResolverEndpoint}'s live state (status, IP address count, host VPC, |
| 9 | * protocols); the endpoint ID is injected automatically. |
| 10 | * |
| 11 | * Provide `Route53Resolver.GetResolverEndpointHttp` on the hosting Lambda |
| 12 | * Function to satisfy the requirement. |
| 13 | * ### Reading Endpoint State |
| 14 | * **Example:** Read the Endpoint Status |
| 15 | * ```typescript |
| 16 | * // init — grants route53resolver:GetResolverEndpoint on the endpoint |
| 17 | * const getEndpoint = yield* AWS.Route53Resolver.GetResolverEndpoint(endpoint); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { ResolverEndpoint } = yield* getEndpoint(); |
| 21 | * console.log(ResolverEndpoint?.Status, ResolverEndpoint?.IpAddressCount); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface GetResolverEndpoint extends Binding.Service< |
| 27 | GetResolverEndpoint, |
| 28 | "AWS.Route53Resolver.GetResolverEndpoint", |
| 29 | ( |
| 30 | endpoint: ResolverEndpoint, |
| 31 | ) => Effect.Effect< |
| 32 | () => Effect.Effect< |
| 33 | r53r.GetResolverEndpointResponse, |
| 34 | r53r.GetResolverEndpointError |
| 35 | > |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const GetResolverEndpoint = Binding.Service<GetResolverEndpoint>( |
| 40 | "AWS.Route53Resolver.GetResolverEndpoint", |
| 41 | ); |