| 1 | import type * as fsx from "@distilled.cloud/aws/fsx"; |
| 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 | * Runtime binding for the `CreateDataRepositoryTask` operation scoped to one |
| 8 | * Lustre file system (IAM actions `fsx:CreateDataRepositoryTask` and |
| 9 | * `fsx:TagResource` on the file system ARN and on `arn:aws:fsx:*:*:task/*`). |
| 10 | * |
| 11 | * Starts a bulk data movement between the bound Lustre {@link FileSystem} |
| 12 | * and its linked S3 data repository — `EXPORT_TO_REPOSITORY`, |
| 13 | * `IMPORT_METADATA_FROM_REPOSITORY`, or `RELEASE_DATA_FROM_FILESYSTEM` — |
| 14 | * from inside a function runtime, e.g. exporting results after a compute |
| 15 | * job completes. A task already executing surfaces the typed |
| 16 | * `DataRepositoryTaskExecuting`. Provide the implementation with |
| 17 | * `Effect.provide(AWS.FSx.CreateDataRepositoryTaskHttp)`. |
| 18 | * ### Data Repository Tasks |
| 19 | * **Example:** Export results to the linked S3 repository |
| 20 | * ```typescript |
| 21 | * const createDataRepositoryTask = |
| 22 | * yield* AWS.FSx.CreateDataRepositoryTask(scratch); |
| 23 | * |
| 24 | * const response = yield* createDataRepositoryTask({ |
| 25 | * Type: "EXPORT_TO_REPOSITORY", |
| 26 | * Paths: ["results/"], |
| 27 | * Report: { Enabled: false }, |
| 28 | * }); |
| 29 | * yield* Effect.log(`task ${response.DataRepositoryTask?.TaskId} started`); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface CreateDataRepositoryTask extends Binding.Service< |
| 35 | CreateDataRepositoryTask, |
| 36 | "AWS.FSx.CreateDataRepositoryTask", |
| 37 | ( |
| 38 | fileSystem: FileSystem, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: Omit<fsx.CreateDataRepositoryTaskRequest, "FileSystemId">, |
| 42 | ) => Effect.Effect< |
| 43 | fsx.CreateDataRepositoryTaskResponse, |
| 44 | fsx.CreateDataRepositoryTaskError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const CreateDataRepositoryTask = |
| 49 | Binding.Service<CreateDataRepositoryTask>("AWS.FSx.CreateDataRepositoryTask"); |