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