| 1 | import type * as ECS from "@distilled.cloud/aws/ecs"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Service } from "./Service.ts"; |
| 5 | |
| 6 | export interface StopServiceDeploymentRequest |
| 7 | extends ECS.StopServiceDeploymentRequest {} |
| 8 | |
| 9 | /** |
| 10 | * Runtime binding for `ecs:StopServiceDeployment`. |
| 11 | * |
| 12 | * Bind this operation to a `Service` inside a function runtime to get a |
| 13 | * callable that stops an in-progress deployment of the bound service — |
| 14 | * either abandoning it or rolling back to the last completed revision. |
| 15 | * The host is granted `ecs:StopServiceDeployment` on the service's |
| 16 | * deployments. |
| 17 | * ### Service Deployments |
| 18 | * **Example:** Roll Back a Bad Deployment |
| 19 | * ```typescript |
| 20 | * const stopServiceDeployment = yield* AWS.ECS.StopServiceDeployment(service); |
| 21 | * |
| 22 | * yield* stopServiceDeployment({ |
| 23 | * serviceDeploymentArn: deploymentArn, |
| 24 | * stopType: "ROLLBACK", |
| 25 | * }); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface StopServiceDeployment extends Binding.Service< |
| 31 | StopServiceDeployment, |
| 32 | "AWS.ECS.StopServiceDeployment", |
| 33 | ( |
| 34 | service: Service, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: StopServiceDeploymentRequest, |
| 38 | ) => Effect.Effect< |
| 39 | ECS.StopServiceDeploymentResponse, |
| 40 | ECS.StopServiceDeploymentError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const StopServiceDeployment = Binding.Service<StopServiceDeployment>( |
| 45 | "AWS.ECS.StopServiceDeployment", |
| 46 | ); |