aws Internal load balancer net::ERR_NAME_NOT_RESOLVED when calling a service

Viewed 285

I have a 3 tier ECS containers application. In presentation tier I have a public subnet where there's an angular app running on nginx server. For that I have application internet-facing load balancer. In the private subnet I have Java Spring REST API service that runs on tomcat server on port 8080, for that there's application internal load balancer. In the other private subnet I have RDS database.

Application client sends requests to internal load balancer url, and renders the response in the application.

While I am able to ssh to ec2 in public subnet and curl to rest service in private subnet and get response: curl -X POST http://internal-qa-XXXXX-XXXXXXX.eu-west-2.elb.amazonaws.com:8080/api/products/all I am not able to receive response when accessing the client in the browser. The application runs correctly, however when inspecting in the browser console I see: POST http://internal-qa-XXXXX-XXXXXXX.eu-west-2.elb.amazonaws.com:8080/api/products/all net::ERR_NAME_NOT_RESOLVED. I checked containers with Docker logs <container_id> and they run just fine. Seurity groups and NACL are configured correctly, I even checked with all traffic allowed

1 Answers

Based on the comments.

The issue is most likely caused by the fact that the url endpoint of the internet load balancer is called from the client side, i.e. browser.

Url of internal load balancer isn't publicly callable.

To solve this, either the application has to be modified to use only publicly available endpoints, or the internal load balancer changed into internet facing.

Related