| 1 | import type * as apprunner from "@distilled.cloud/aws/apprunner"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Service } from "./Service.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Start a manual deployment of an App Runner {@link Service} from a Lambda |
| 8 | * (or other AWS runtime) — App Runner re-pulls the latest image (or commit) |
| 9 | * and rolls a new container fleet. The call is asynchronous; pair with |
| 10 | * {@link ListOperations} to track the returned `OperationId` to completion. |
| 11 | * |
| 12 | * Provide `AppRunner.StartDeploymentHttp` on the hosting function's Effect |
| 13 | * to implement the binding. |
| 14 | * |
| 15 | * ### Deploying at Runtime |
| 16 | * **Example:** Trigger a deployment and return its operation id |
| 17 | * ```typescript |
| 18 | * const startDeployment = yield* AppRunner.StartDeployment(service); |
| 19 | * const { OperationId } = yield* startDeployment(); |
| 20 | * ``` |
| 21 | * |
| 22 | * @binding |
| 23 | */ |
| 24 | export interface StartDeployment extends Binding.Service< |
| 25 | StartDeployment, |
| 26 | "AWS.AppRunner.StartDeployment", |
| 27 | ( |
| 28 | service: Service, |
| 29 | ) => Effect.Effect< |
| 30 | () => Effect.Effect< |
| 31 | apprunner.StartDeploymentResponse, |
| 32 | apprunner.StartDeploymentError |
| 33 | > |
| 34 | > |
| 35 | > {} |
| 36 | export const StartDeployment = Binding.Service<StartDeployment>( |
| 37 | "AWS.AppRunner.StartDeployment", |
| 38 | ); |