I am trying to call my private API gateway from a lambda function in another AWS account. But i am getting timeout while making the call (Actually the http call is just stuck and hits my client side timeout).
In the AWS account which hosts the private AWS account i did the following * Created my private API gateway and lambda behind the API
- Create resource policy and provided access to the VPC endpoint of the other AWS caller (caller)
- create VPC endpoint with private DNS enabled.
- Attached policy to VPC endpoint with full access, security group with access to all traffic.
In the second AWS account (caller) i did the following * Create VPC and VPC endpoint for API gateway with full access.
- created lambda in the VPC with security group with access to all traffic (inbound and outbound)
- In lambda I am using the public DNS of the VPC endpoint(Account 1) and used header 'x-apigw-api-id'
I already tried the debugging steps mentioned in this page https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-private-endpoint-connection/. Also tried whitelisting based on the VPC ID instead of VPC endpoint ID.
Any suggestions for resolving this issue.