| 1 | import type * as SSM from "@distilled.cloud/aws/ssm"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Parameter } from "./Parameter.ts"; |
| 5 | |
| 6 | export interface LabelParameterVersionRequest extends Omit< |
| 7 | SSM.LabelParameterVersionRequest, |
| 8 | "Name" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `ssm:LabelParameterVersion`. |
| 13 | * |
| 14 | * Bind this operation to a `Parameter` inside a function runtime to get a |
| 15 | * callable that attaches labels (e.g. `current`, `stable`) to a version of |
| 16 | * the bound parameter. Omitting `ParameterVersion` labels the latest version. |
| 17 | * Labels enable versioned rollouts: readers pass `Name:label` selectors to |
| 18 | * `GetParameter` while writers move the label between versions. |
| 19 | * ### Labeling Parameter Versions |
| 20 | * **Example:** Mark the Latest Version as Current |
| 21 | * ```typescript |
| 22 | * const label = yield* SSM.LabelParameterVersion(config); |
| 23 | * |
| 24 | * const result = yield* label({ Labels: ["current"] }); |
| 25 | * yield* Effect.log(`labeled version ${result.ParameterVersion}`); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface LabelParameterVersion extends Binding.Service< |
| 31 | LabelParameterVersion, |
| 32 | "AWS.SSM.LabelParameterVersion", |
| 33 | <P extends Parameter>( |
| 34 | parameter: P, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: LabelParameterVersionRequest, |
| 38 | ) => Effect.Effect< |
| 39 | SSM.LabelParameterVersionResult, |
| 40 | SSM.LabelParameterVersionError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const LabelParameterVersion = Binding.Service<LabelParameterVersion>( |
| 45 | "AWS.SSM.LabelParameterVersion", |
| 46 | ); |