1import type * as SD from "@distilled.cloud/aws/servicediscovery";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Service } from "./Service.ts";
5
6/**
7 * `GetInstance` request with `ServiceId` injected from the bound
8 * {@link Service}.
9 */
10export interface GetInstanceRequest extends Omit<
11 SD.GetInstanceRequest,
12 "ServiceId"
13> {}
14
15/**
16 * Runtime binding for `servicediscovery:GetInstance` — reads a single
17 * registered instance of the bound {@link Service} by its instance ID,
18 * returning its full attribute map. Provide the implementation with
19 * `Effect.provide(AWS.CloudMap.GetInstanceHttp)`.
20 * ### Reading Instances
21 * **Example:** Read an Instance's Attributes
22 * ```typescript
23 * const getInstance = yield* AWS.CloudMap.GetInstance(service);
24 *
25 * const { Instance } = yield* getInstance({ InstanceId: "worker-1" });
26 * console.log(Instance?.Attributes?.AWS_INSTANCE_IPV4);
27 * ```
28 *
29 * @binding
30 */
31export interface GetInstance extends Binding.Service<
32 GetInstance,
33 "AWS.CloudMap.GetInstance",
34 <S extends Service>(
35 service: S,
36 ) => Effect.Effect<
37 (
38 request: GetInstanceRequest,
39 ) => Effect.Effect<SD.GetInstanceResponse, SD.GetInstanceError>
40 >
41> {}
42export const GetInstance = Binding.Service<GetInstance>(
43 "AWS.CloudMap.GetInstance",
44);