We have a Fargate service that should be exposed to the internet via a load balancer, and since for tests we had used so far the random Public IP of the task, we decided to disable the Public IP, so that it makes sense for the task of the service to be accessible via the load balancer only.
Disabling the Public IP though seems to make the container inside Fargate unable to download the env file from S3. The strange fact is that the image from ECR is pulled but the task fails when it tries to get the env file.
According to this: https://aws.amazon.com/premiumsupport/knowledge-center/ecs-task-environment-variables/
If your ECS task is in a public subnet, verify the following: Be sure that task has a public IP address enabled.
The service is in a public subnet, so according to this we should have the public IP.
Is there a reason for this since the public subnet should in itself have access to the internet? And why does the ECR pull work anyways?
Thanks