- Newest
- Most votes
- Most comments
Hi,
You can access a Private NLB via VPC Private Link: https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-share-your-services.html
The page above details your exact use case:
Best,
Didier
Hello,
You're correct that CloudFront, by itself, cannot access resources within your VPC, including your internal NLB. Here are approache to allow your CloudFront React.js app to access your internal NLB:
API Gateway with VPC Link:
Yes, creating an API Gateway with a VPC Link is a good approach. Here's how it works:
API Gateway: Exposes a public endpoint for your React.js app to interact with. VPC Link: Connects the API Gateway to your VPC, allowing it to communicate with your internal NLB. Benefits:
Security: You can control access to the API Gateway using IAM policies, ensuring only authorized requests reach your NLB. Flexibility: API Gateway can handle various request types (GET, POST, etc.) and manipulate data before forwarding it to your NLB.
Troubleshooting:
Connectivity Issues: Ensure proper configuration of the VPC Link, security groups, and route tables. Check CloudWatch logs for API Gateway and NLB for any errors.
API Gateway with VPC Link
API Gateway Developer Guide:
https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started.html
CloudFront is located outside VPC, so it can NOT directly access your Private Load Balancer.
Please check this answer
Relevant content
- Accepted Answerasked 9 months ago
- Accepted Answerasked 16 days ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Thank you for your previous response.
I have configured my Network Load Balancer (NLB) within a VPC Private Link and created an API Gateway with the necessary resources to connect to it. However, I am encountering an issue where I am unable to reach my NLB through the VPC Link. The API Gateway returns an internal server error with the following message:
Execution failed due to configuration error: There was an internal error while executing your request
Unfortunately, I do not have additional logs to further diagnose the issue. Could you please advise on how to debug this situation? Any guidance or suggestions would be greatly appreciated.
Thank you for your assistance.