The host name (domain name) of the backend service that we want to reach through the ALB.
This is used to:
Host
header on the request when forwarding to the ALB, so that requests can be
routed to the correct Target GroupExample value: <service>.staging.my-project.liflig.io
(not prefixed by https://
).
A listener on e.g. port 443 (HTTPS).
See the note on ApiGateway about the load balancer security group.
Optional
mapMap request parameters (add/overwrite path/headers/query params) before forwarding to the backend.
See https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html for more on this. Read the 'Reserved headers' section for which headers cannot be overridden. In addition to the AWS-reserved headers, you should not override the 'Host' header either, as that's used for routing the request to the correct service behind the load balancer.
Adding a header:
mapParameters: (parameters) => parameters.overwriteHeader(
"X-My-Custom-Header",
apigw.MappingValue.custom("my-custom-value"),
)
Overwriting the path (if, for example, you configure a /users
route on the API Gateway that
you want to forward to /api/users
on the backend):
mapParameters: (parameters) => parameters.overwritePath("/api/users")
A security group (SG) that allows incoming traffic to the ALB. Will be used by the VPC link, so the API-GW integration can connect.
This is usually the same SG as the ALB uses, because they have a rule that allows traffic from others in the same SG.
See the note on ApiGateway about the load balancer security group.
The VPC used by the ALB. The API-GW integration will connect to the ALB using a VPC Link for this VPC.
See the note on ApiGateway about the load balancer security group.
Props for the API-GW -> ALB (Application Load Balancer) integration.
See the note on ApiGateway about the load balancer security group.