I have a react frontend and flask backend and I would like to deploy them with ECS. I want to make the react app public facing and the flask server to be hidden and not accessible from the outside world.
From what I read, the approach should be as follows:
- create a public and private subnets with NAT gateway on the public subnet for the flask server.
- deploy the react app in the public sub and the server on the private sub.
Now here is where I get confused:
- How can I expose the react app to the outside world? should I use Internet gateway or ELB/ALB? what are the differences?
- How do I make the react app talk to the server when the server only have private IP? Service discovery? And if so, how should I inject the server's service name to the react app using docker?