1import * as apprunner from "@distilled.cloud/aws/apprunner";
2import { makeAppRunnerHttpBinding } from "./BindingHttp.ts";
3import type { Service } from "./Service.ts";
4import { StartDeployment } from "./StartDeployment.ts";
5
6/**
7 * HTTP implementation of the {@link StartDeployment} binding. Calls
8 * `apprunner:StartDeployment` with the Lambda's IAM role, scoped to the
9 * bound service.
10 */
11export const StartDeploymentHttp = makeAppRunnerHttpBinding(StartDeployment, {
12 operation: apprunner.startDeployment,
13 spec: (service: Service) => ({
14 identifiers: { ServiceArn: service.serviceArn },
15 iam: () => ({
16 actions: ["apprunner:StartDeployment"],
17 resources: [service.serviceArn],
18 }),
19 }),
20});