| 1 | import type * as efs from "@distilled.cloud/aws/efs"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { FileSystem } from "./FileSystem.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `DescribeMountTargets` request with `FileSystemId` injected from the bound |
| 8 | * {@link FileSystem}. |
| 9 | */ |
| 10 | export interface DescribeMountTargetsRequest extends Omit< |
| 11 | efs.DescribeMountTargetsRequest, |
| 12 | "FileSystemId" |
| 13 | > {} |
| 14 | |
| 15 | /** |
| 16 | * Runtime binding for the `DescribeMountTargets` operation (IAM action |
| 17 | * `elasticfilesystem:DescribeMountTargets` on the file system ARN). |
| 18 | * |
| 19 | * Lists the bound {@link FileSystem}'s mount targets — the per-AZ NFS |
| 20 | * endpoints with their IP addresses and lifecycle states. Useful for health |
| 21 | * checks and for compute that needs to discover a mount target's IP at |
| 22 | * runtime. Provide the implementation with |
| 23 | * `Effect.provide(AWS.EFS.DescribeMountTargetsHttp)`. |
| 24 | * ### Inspecting File Systems |
| 25 | * **Example:** List the file system's mount targets |
| 26 | * ```typescript |
| 27 | * const describeMountTargets = yield* AWS.EFS.DescribeMountTargets(files); |
| 28 | * |
| 29 | * const { MountTargets } = yield* describeMountTargets(); |
| 30 | * for (const target of MountTargets ?? []) { |
| 31 | * yield* Effect.log(`${target.AvailabilityZoneName}: ${target.IpAddress}`); |
| 32 | * } |
| 33 | * ``` |
| 34 | * |
| 35 | * @binding |
| 36 | */ |
| 37 | export interface DescribeMountTargets extends Binding.Service< |
| 38 | DescribeMountTargets, |
| 39 | "AWS.EFS.DescribeMountTargets", |
| 40 | ( |
| 41 | fileSystem: FileSystem, |
| 42 | ) => Effect.Effect< |
| 43 | ( |
| 44 | request?: DescribeMountTargetsRequest, |
| 45 | ) => Effect.Effect< |
| 46 | efs.DescribeMountTargetsResponse, |
| 47 | efs.DescribeMountTargetsError |
| 48 | > |
| 49 | > |
| 50 | > {} |
| 51 | export const DescribeMountTargets = Binding.Service<DescribeMountTargets>( |
| 52 | "AWS.EFS.DescribeMountTargets", |
| 53 | ); |