1import type * as appconfig from "@distilled.cloud/aws/appconfig";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Application } from "./Application.ts";
5import type { Environment } from "./Environment.ts";
6
7export interface StopDeploymentRequest extends Omit<
8 appconfig.StopDeploymentRequest,
9 "ApplicationId" | "EnvironmentId"
10> {}
11
12/**
13 * Stop (or revert) an AppConfig deployment from a Lambda (or other AWS
14 * runtime). Stopping an in-progress rollout rolls it back; with
15 * `AllowRevert: true` a completed deployment can be reverted within 72
16 * hours.
17 *
18 * Provide `AppConfig.StopDeploymentHttp` on the hosting function's Effect to
19 * implement the binding.
20 *
21 * ### Deploying Configuration at Runtime
22 * **Example:** Roll back an in-progress rollout
23 * ```typescript
24 * const stopDeployment = yield* AppConfig.StopDeployment(app, env);
25 * yield* stopDeployment({ DeploymentNumber: 2 });
26 * ```
27 *
28 * @binding
29 */
30export interface StopDeployment extends Binding.Service<
31 StopDeployment,
32 "AWS.AppConfig.StopDeployment",
33 (
34 application: Application,
35 environment: Environment,
36 ) => Effect.Effect<
37 (
38 request: StopDeploymentRequest,
39 ) => Effect.Effect<appconfig.Deployment, appconfig.StopDeploymentError>
40 >
41> {}
42export const StopDeployment = Binding.Service<StopDeployment>(
43 "AWS.AppConfig.StopDeployment",
44);