How to reference container hostname or ip from another container in the same ECS task in cloud formation

Solution 1:

If you are using the awsvpc networking mode for your task (which would be a good idea) your task will basically have a single network name space. This means you can reach all of your containers using localhost. In other words if you try to reach localhost:9201 from any other container in the same task you will end up talking to your promscale container.