@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 40 lines 1.39 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 RotateSecretRequest extends Omit<secretsmanager.RotateSecretRequest, "SecretId"> {}
7
8 /**
9 * Runtime binding for `secretsmanager:RotateSecret`.
10 *
11 * Bind this operation to a `Secret` to get a callable that triggers an
12 * immediate rotation using the secret's configured rotation function (see
13 * {@link onSecretRotation} for wiring one up). Provide the implementation
14 * with `Effect.provide(AWS.SecretsManager.RotateSecretHttp)`.
15 * ### Rotating Secrets
16 * **Example:** Trigger an On-Demand Rotation
17 * ```typescript
18 * // init — bind the operation to the secret
19 * const rotateSecret = yield* AWS.SecretsManager.RotateSecret(secret);
20 *
21 * // runtime — kicks off the configured rotation function
22 * const result = yield* rotateSecret();
23 * const pendingVersionId = result.VersionId;
24 * ```
25 *
26 * @binding
27 */
28 export interface RotateSecret extends Binding.Service<
29 RotateSecret,
30 "AWS.SecretsManager.RotateSecret",
31 (
32 secret: Secret,
33 ) => Effect.Effect<
34 (
35 request?: RotateSecretRequest,
36 ) => Effect.Effect<secretsmanager.RotateSecretResponse, secretsmanager.RotateSecretError>
37 >
38 > {}
39
40 export const RotateSecret = Binding.Service<RotateSecret>("AWS.SecretsManager.RotateSecret");