Lets say I have 2 containers. One with nginx and and another with a simple app. Each container has his own ECR repo image and his own Task Definition. My nginx container is running in a public subnet with a public IP. How do I pass the request from nginx to my container like this:
proxy_pass app_container:9000;
How can I make my second container only visible to nginx container? Should I put him in a private subnet? Do I need to map a port for the app container in the task definition? Should I use Cloud Map? Should I call him with localhost:9000? Will the container be called the same as it is in the task definition?
I tried using service discovery but I still dont know how to call my container. I created the container, its running, but my nginx container cant reach him doesnt matter how I try, the documentation doesnt explain it well. How exactly should i call my container?