How do I integrate an API Gateway REST API with an Application Load Balancer?
Last updated: 2021-01-27
I want to integrate an Amazon API Gateway REST API with an Application Load Balancer. How can I do that using API Gateway integrations?
To integrate your API Gateway REST API with a public Application Load Balancer, use API Gateway HTTP integration.
For private Application Load Balancers, use API Gateway VPC link to first connect to a private Network Load Balancer. Then, use the Network Load Balancer to forward API Gateway requests to the private Application Load Balancer.
Note: There's currently no direct API Gateway integration for private Application Load Balancers.
To integrate an API Gateway REST API with a public Application Load Balancer
Note: The following procedure assumes two things:
- You have access to a public Application Load Balancer and its DNS name.
- You have an API Gateway REST API resource with an HTTP method.
1. In the API Gateway console, choose the API you want to integrate with the Application Load Balancer.
2. In the Resources pane, for Methods, choose the HTTP method that your API uses.
3. Choose Integration Request.
4. In the Integration Request pane, for Integration Type, choose HTTP.
Note: To pass the entire API request and its parameters to the backend Application Load Balancer, create either an HTTP proxy integration or an HTTP custom integration instead. For more information, see Set up HTTP integrations in API Gateway.
5. In the Endpoint URL field, enter either the Application Load Balancer's default DNS name or custom DNS name. If you use the default DNS name, enter http:// as the URL scheme. If you use a custom DNS name, enter https:// as the URL scheme.
Note: Make sure that you create an HTTP listener or HTTPS listener for the Application Load Balancer using the port and listener rules of your choice. For more information, see Listeners for your Application Load Balancer.
6. Choose Save.
7. Deploy the API.