| 1 | import type * as SVC from "@distilled.cloud/aws/codedeploy"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { DeploymentGroup } from "./DeploymentGroup.ts"; |
| 5 | |
| 6 | export interface CreateDeploymentRequest extends Omit< |
| 7 | SVC.CreateDeploymentInput, |
| 8 | "applicationName" | "deploymentGroupName" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `codedeploy:CreateDeployment` — lets a workload start |
| 13 | * a deployment through the bound deployment group (e.g. shifting a Lambda |
| 14 | * alias or rolling an EC2 fleet to a new revision). |
| 15 | * |
| 16 | * The response carries the created `deploymentId`, which can be observed |
| 17 | * with the {@link GetDeployment} binding. |
| 18 | * ### Starting Deployments |
| 19 | * **Example:** Deploy a Registered Revision |
| 20 | * ```typescript |
| 21 | * const createDeployment = yield* AWS.CodeDeploy.CreateDeployment(group); |
| 22 | * |
| 23 | * const { deploymentId } = yield* createDeployment({ |
| 24 | * revision: { |
| 25 | * revisionType: "S3", |
| 26 | * s3Location: { bucket, key, bundleType: "zip" }, |
| 27 | * }, |
| 28 | * }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface CreateDeployment extends Binding.Service< |
| 34 | CreateDeployment, |
| 35 | "AWS.CodeDeploy.CreateDeployment", |
| 36 | <G extends DeploymentGroup>( |
| 37 | group: G, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request?: CreateDeploymentRequest, |
| 41 | ) => Effect.Effect<SVC.CreateDeploymentOutput, SVC.CreateDeploymentError> |
| 42 | > |
| 43 | > {} |
| 44 | export const CreateDeployment = Binding.Service<CreateDeployment>( |
| 45 | "AWS.CodeDeploy.CreateDeployment", |
| 46 | ); |