Is it possible to access a public domain e.g. foo.bar.com from an AWS ECS task running on a private subnet? It is convenient for me that the task is running on a private subnet since it can be easily accessible from other ECS tasks running on the same private subnet (same AZ, VPC and region).
I am reading different contradicting opinions:

Some say that this is not possible and I must configure a NAT Gateway or NAT instance
Others say that this is possible as long as you specify the right outbound rules for your security groups. But outbound rules can only be configured using IP ranges and not specific domains.

What is actually the case here?

AWS ECS Task on private subnet connectivity
You have to create a NAT Gateway and add a route in the route table for your subnet. Without a NAT Gateway (or NAT instance, but those are considered obsolete), you cannot connect to the public internet from your private subnets.
