1
votes

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
"however in the console " which console? AWS console? - Marcin
browser console, sorry - Patryk Maryn
But isn't the internal-qa-XXXXX endpoint for the internal LB? If yes, then it can't be access from a browser over internet, like if you call it from JavaScript in your app. - Marcin
It seems like the internal endpoint is called by client from my browser, and instead it should call internally between subnets. I think the the browser treats the endpoint as public ip therefore it can;t be accessed - Patryk Maryn
It seems so. If you don't mind I will probably an answer for future reference. - Marcin

1 Answers

1
votes

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.