@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 39 lines 1.47 KB
Raw
1 import type * as datazone from "@distilled.cloud/aws/datazone";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Environment } from "./Environment.ts";
5
6 /**
7 * Runtime binding for `datazone:GetEnvironmentCredentials`.
8 *
9 * Fetches the short-lived AWS credentials of the bound environment's provisioned user role. The `secretAccessKey` and `sessionToken` are `Redacted` — unwrap with `Redacted.value` only at the point of use. The domain and environment ids are injected from the binding.
10 * Provide the implementation with
11 * `Effect.provide(AWS.DataZone.GetEnvironmentCredentialsHttp)`.
12 * ### Environment Credentials
13 * **Example:** Assume the Environment's Role
14 * ```typescript
15 * // init — bind the operation to the environment
16 * const getEnvironmentCredentials = yield* AWS.DataZone.GetEnvironmentCredentials(environment);
17 *
18 * // runtime
19 * const creds = yield* getEnvironmentCredentials();
20 * const secret = Redacted.value(creds.secretAccessKey!);
21 * ```
22 *
23 * @binding
24 */
25 export interface GetEnvironmentCredentials extends Binding.Service<
26 GetEnvironmentCredentials,
27 "AWS.DataZone.GetEnvironmentCredentials",
28 (
29 environment: Environment,
30 ) => Effect.Effect<
31 () => Effect.Effect<
32 datazone.GetEnvironmentCredentialsOutput,
33 datazone.GetEnvironmentCredentialsError
34 >
35 >
36 > {}
37 export const GetEnvironmentCredentials = Binding.Service<GetEnvironmentCredentials>(
38 "AWS.DataZone.GetEnvironmentCredentials",
39 );