- Newest
- Most votes
- Most comments
When encountering an "Internal Server Error" with API Gateway connecting to an ECS service through a VPC Link, there are several potential causes and troubleshooting steps to consider.
First, it's important to understand that when you create a VPC link, API Gateway provisions Elastic Network Interfaces to access your VPC. This provisioning process can take several minutes to complete. If you're trying to use the VPC link immediately after creation, it might not be fully provisioned yet, resulting in the internal server error you're experiencing.
For troubleshooting this issue:
-
Verify that your VPC link has completed provisioning. Check the status in the API Gateway console to ensure it's "Available" and not still in the "Pending" state.
-
Ensure that the security groups associated with your VPC link allow traffic from API Gateway to your ECS service on the required port (port 80 in your case).
-
Check that your integration URI is correctly formatted. When using CloudMap service discovery, make sure the ARN format is correct and that the service is properly registered.
-
Verify that your ECS service is properly configured to accept traffic from the VPC link. The security groups for your ECS tasks should allow inbound traffic from the security group associated with the VPC link.
-
For more detailed error information, you can enable execution logs for your API Gateway. This will provide more context about what's happening when the request is processed.
-
Consider checking CloudWatch Logs for any error messages related to your API Gateway or ECS service.
-
Verify that your API Gateway integration is correctly set up with the HTTP_PROXY integration type and the proper connection to your VPC link.
If you're still experiencing issues, you might want to temporarily set up a Network Load Balancer as an intermediate step to help isolate whether the problem is with the API Gateway configuration, the VPC link, or the CloudMap service discovery.
Sources
API Gateway + VPC Private Link : Interna Server Error | AWS re:Post
Tutorial: Create an HTTP API with a private integration to an Amazon ECS service - Amazon API Gateway
Tutorial: Create a REST API with a private integration - Amazon API Gateway
answered a year ago
Relevant content
asked a year ago
asked 2 years ago
asked 2 years ago

I already asked Amazon Q to help check their status. it hadn't found any issue. I don't want to use NLB