1import type * as efs from "@distilled.cloud/aws/efs";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { FileSystem } from "./FileSystem.ts";
5
6/**
7 * `CreateAccessPoint` request with `FileSystemId` injected from the bound
8 * {@link FileSystem}.
9 */
10export interface CreateAccessPointRequest extends Omit<
11 efs.CreateAccessPointRequest,
12 "FileSystemId"
13> {}
14
15/**
16 * Runtime binding for the `CreateAccessPoint` operation (IAM actions
17 * `elasticfilesystem:CreateAccessPoint` on the file system ARN and
18 * `elasticfilesystem:TagResource` for tag-on-create).
19 *
20 * Creates an access point into the bound {@link FileSystem} at runtime —
21 * the multi-tenant pattern where each tenant gets its own POSIX identity
22 * and root directory carved out of one file system. `ClientToken` makes the
23 * create idempotent; a repeated identical create surfaces the typed
24 * `AccessPointAlreadyExists`. For statically-known access points, prefer the
25 * {@link AccessPoint} resource. Provide the implementation with
26 * `Effect.provide(AWS.EFS.CreateAccessPointHttp)`.
27 * ### Managing Access Points at Runtime
28 * **Example:** Create a per-tenant access point
29 * ```typescript
30 * const createAccessPoint = yield* AWS.EFS.CreateAccessPoint(files);
31 *
32 * const accessPoint = yield* createAccessPoint({
33 * ClientToken: `tenant-${tenantId}`,
34 * PosixUser: { Uid: 1000, Gid: 1000 },
35 * RootDirectory: {
36 * Path: `/tenants/${tenantId}`,
37 * CreationInfo: { OwnerUid: 1000, OwnerGid: 1000, Permissions: "750" },
38 * },
39 * });
40 * ```
41 *
42 * @binding
43 */
44export interface CreateAccessPoint extends Binding.Service<
45 CreateAccessPoint,
46 "AWS.EFS.CreateAccessPoint",
47 (
48 fileSystem: FileSystem,
49 ) => Effect.Effect<
50 (
51 request: CreateAccessPointRequest,
52 ) => Effect.Effect<efs.AccessPointDescription, efs.CreateAccessPointError>
53 >
54> {}
55export const CreateAccessPoint = Binding.Service<CreateAccessPoint>(
56 "AWS.EFS.CreateAccessPoint",
57);