@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 51 lines 1.56 KB
Raw
1 import * as secretsmanager from "@distilled.cloud/aws/secrets-manager";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Secret } from "./Secret.ts";
5
6 export interface PutSecretValueRequest extends Omit<
7 secretsmanager.PutSecretValueRequest,
8 "SecretId"
9 > {}
10
11 /**
12 * Runtime binding for `secretsmanager:PutSecretValue`.
13 *
14 * Bind this operation to a `Secret` to get a callable that writes a new
15 * secret version (string or binary); the new version becomes `AWSCURRENT`.
16 * Provide the implementation with
17 * `Effect.provide(AWS.SecretsManager.PutSecretValueHttp)`.
18 * ### Writing Secret Values
19 * **Example:** Rotate a Secret's Value
20 * ```typescript
21 * // init — bind the operation to the secret
22 * const putSecretValue = yield* AWS.SecretsManager.PutSecretValue(secret);
23 *
24 * // runtime — write a new version; the response carries its VersionId
25 * const result = yield* putSecretValue({
26 * SecretString: newPassword,
27 * });
28 * ```
29 *
30 * **Example:** Store a Binary Payload
31 * ```typescript
32 * yield* putSecretValue({
33 * SecretBinary: new TextEncoder().encode(JSON.stringify(credentials)),
34 * });
35 * ```
36 *
37 * @binding
38 */
39 export interface PutSecretValue extends Binding.Service<
40 PutSecretValue,
41 "AWS.SecretsManager.PutSecretValue",
42 (
43 secret: Secret,
44 ) => Effect.Effect<
45 (
46 request: PutSecretValueRequest,
47 ) => Effect.Effect<secretsmanager.PutSecretValueResponse, secretsmanager.PutSecretValueError>
48 >
49 > {}
50
51 export const PutSecretValue = Binding.Service<PutSecretValue>("AWS.SecretsManager.PutSecretValue");