- Newest
- Most votes
- Most comments
Based on how API Gateway handles VPC link integrations, your observations are correct. Let me clarify the distinct roles of these two parameters:
Integration Target vs Endpoint URL:
The integration target (specified as the ARN of your Application Load Balancer or Network Load Balancer) is what actually determines where API Gateway routes your requests. This is the critical parameter for VPC link integrations - it tells API Gateway which load balancer in your VPC to send traffic to.
The endpoint URL serves a different purpose: it's primarily used to set the Host header of the integration request, not for routing. This is why your integration works when you change the endpoint URL to a dummy link but keep the integration target - API Gateway is still routing to the load balancer specified in the integration target.
Regarding the Path Behavior:
Yes, when you include a path in your endpoint URL (like www.abc.com/app/user/get), API Gateway does use that path. The path portion from the endpoint URL gets incorporated into the request sent to your integration target. This allows you to specify a base path that should be prepended to requests going through the VPC link.
In summary: for VPC link integrations, the integration target determines where the request goes (which load balancer), while the endpoint URL primarily sets the Host header and can provide a base path for your requests. The integration target is the required parameter for proper routing, which explains why your integration didn't work when you only specified the endpoint URL.
Sources
Tutorial: Create a REST API with a private integration - Amazon API Gateway
Set up a private integration - Amazon API Gateway
x-amazon-apigateway-integration object - Amazon API Gateway
answered a month ago
Relevant content
asked 3 years ago
