- Newest
- Most votes
- Most comments
The only way to get from API Gateway to private resources is using VPC Link, and VPC Link requires an NLB (No need for an ALB between the NLB and the endpoints). So your path will be: Public API -> VPC Link -> NLB -> Private API VPC Endpoint -> Private API.
Saying that, you don't really must use private APIs. you could just protect the internal APIs' endpoints using IAM and the ones that you want public using some other approach (e.g. Cognito).
@Steef
Almost two years later, but there is not much information available about this topic, so an answer could still help the community.
If you want to proxy requests to a Private API Gateway, using the http_proxy integration is not the right approach. A Private API Gateway is accessible only within a VPC, and the correct method to achieve this is by using a VPC Link as mentioned in the first answer.
But If your goal is to restrict access between two Public Api Gateways with IAM authorization, you must ensure that every request is signed with SigV4. This will add IAM credentials to the request. Currently, the only way to achieve this is by using a Lambda integration in Api Gateway B that signs the request and proxies it to the Public API Gateway A. Than you can use the Lambda (execution) role that signs the request in the resource policy of Public Api Gateway A. By default, the http_proxy integration does not include IAM credentials in the request, so the target API Public Gateway (A) cannot recognize it as a request from the origin API Gateway (B). Resource policies won't work in this setup.
However, if you implement the setup as described above—using a VPC Link integration in conjunction with a VPC Endpoint—IAM credentials will be included in the request to the private API Gateway. In this scenario, you can configure a resource policy on the Private API Gateway to allow requests originating from the Public API Gateway. It's an additional layer of security that restrict access within your VPC and here you can allow only the Public API (via the vpc link) to make requests to the Private API Gateway, even if you are in the same VPC and subnet.
answered 2 years ago
Relevant content
asked 2 years ago

It's unfortunate that the NLB is still required, but at least it's better than both my current suggestions (+1). If no alternatives present themselves in the next 24 hours, I'll mark this as the accepted answer. Thanks!
Also, you're right about strict IAM + Cognito. And I will be using both in this solution. But I've seen enough loose/misconfigured IAM policies in my time that I'll be a lot more confident with the additional network isolation.
@Uri what type of target group would you add to the NLB?
Look at point #4 in this blog. It talks about custom domain names for private APIs, but the same idea applies.
Ah! Perfect. That's exactly what I was looking for. Marking as accepted. Thank you.
I've tried to configure the suggested way (public API's protected by Cognito and private using IAM Authorization) but when configuring a http_proxy from the public (Cognito protected) to the private (IAM protected) I keep getting 'forbidden' errors because a Role with correct policies are not part of the request. How would you configure the integration request to the API Gateway that is protected by IAM Authorization?