1import type * as ds from "@distilled.cloud/aws/directory-service";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Directory } from "./Directory.ts";
5
6/**
7 * Runtime binding for the `CreateComputer` operation (IAM action
8 * `ds:CreateComputer`), scoped to one {@link Directory}.
9 *
10 * Creates a computer account in the bound directory — the programmatic half
11 * of joining a machine to the domain (e.g. from an instance-provisioning
12 * workflow). `Password` is the one-time machine password and is sensitive;
13 * pass a `Redacted` value. The directory id is injected from the binding.
14 * Provide the implementation with
15 * `Effect.provide(AWS.DirectoryService.CreateComputerHttp)`.
16 * ### Managing Computers
17 * **Example:** Create a Computer Account
18 * ```typescript
19 * // init — bind the operation to the directory
20 * const createComputer = yield* AWS.DirectoryService.CreateComputer(directory);
21 *
22 * // runtime
23 * const { Computer } = yield* createComputer({
24 * ComputerName: "BUILD-AGENT-01",
25 * Password: Redacted.make("0ne-Time-Secret!"),
26 * });
27 * ```
28 *
29 * @binding
30 */
31export interface CreateComputer extends Binding.Service<
32 CreateComputer,
33 "AWS.DirectoryService.CreateComputer",
34 (
35 directory: Directory,
36 ) => Effect.Effect<
37 (
38 request: Omit<ds.CreateComputerRequest, "DirectoryId">,
39 ) => Effect.Effect<ds.CreateComputerResult, ds.CreateComputerError>
40 >
41> {}
42export const CreateComputer = Binding.Service<CreateComputer>(
43 "AWS.DirectoryService.CreateComputer",
44);