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

main
ts 41 lines 1.56 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 PutParameterRequest extends Omit<SSM.PutParameterRequest, "Name"> {}
7
8 /**
9 * Runtime binding for `ssm:PutParameter`.
10 *
11 * Bind this operation to a `Parameter` inside a function runtime to get a
12 * callable that writes a new version of the bound parameter — e.g. flipping a
13 * feature flag or rotating a stored secret at runtime. For `SecureString`
14 * parameters the binding also grants `kms:Encrypt` and `kms:GenerateDataKey`
15 * on the parameter's encryption key.
16 *
17 * Pass `Overwrite: true` to update the existing parameter (the parameter
18 * already exists — it is managed by the `Parameter` resource). Note that a
19 * runtime write drifts the value from the deployed desired state; the next
20 * deploy converges it back.
21 * ### Writing a Parameter
22 * **Example:** Update a Feature Flag at Runtime
23 * ```typescript
24 * const putFlag = yield* SSM.PutParameter(flag);
25 *
26 * const result = yield* putFlag({ Value: "on", Overwrite: true });
27 * yield* Effect.log(`flag now at version ${result.Version}`);
28 * ```
29 *
30 * @binding
31 */
32 export interface PutParameter extends Binding.Service<
33 PutParameter,
34 "AWS.SSM.PutParameter",
35 <P extends Parameter>(
36 parameter: P,
37 ) => Effect.Effect<
38 (request: PutParameterRequest) => Effect.Effect<SSM.PutParameterResult, SSM.PutParameterError>
39 >
40 > {}
41 export const PutParameter = Binding.Service<PutParameter>("AWS.SSM.PutParameter");