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