@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, 06:00 UTC

main
ts 42 lines 1.4 KB
Raw
1 import type * as SSM from "@distilled.cloud/aws/ssm";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Parameter } from "./Parameter.ts";
5
6 export interface GetParameterRequest extends Omit<SSM.GetParameterRequest, "Name"> {}
7
8 /**
9 * Runtime binding for `ssm:GetParameter`.
10 *
11 * Bind this operation to a `Parameter` inside a function runtime to get a
12 * callable that automatically injects the parameter name. For `SecureString`
13 * parameters the binding also grants `kms:Decrypt` on the parameter's
14 * encryption key so `WithDecryption: true` works out of the box.
15 * ### Reading a Parameter
16 * **Example:** Read a String Parameter
17 * ```typescript
18 * const getParameter = yield* SSM.GetParameter(config);
19 *
20 * const result = yield* getParameter();
21 * const value = result.Parameter?.Value;
22 * ```
23 *
24 * **Example:** Read a SecureString Parameter with Decryption
25 * ```typescript
26 * const getSecret = yield* SSM.GetParameter(apiKey);
27 *
28 * const result = yield* getSecret({ WithDecryption: true });
29 * ```
30 *
31 * @binding
32 */
33 export interface GetParameter extends Binding.Service<
34 GetParameter,
35 "AWS.SSM.GetParameter",
36 <P extends Parameter>(
37 parameter: P,
38 ) => Effect.Effect<
39 (request?: GetParameterRequest) => Effect.Effect<SSM.GetParameterResult, SSM.GetParameterError>
40 >
41 > {}
42 export const GetParameter = Binding.Service<GetParameter>("AWS.SSM.GetParameter");