I do have a terraform scripts that provisions the tasks in ECS. When I try to run the task in ap-southeast-1
region it gives me this error:
Task stopped at: 2024-04-28T08:22:13.519Z
CannotPullContainerError: pull image manifest has been retried 5 time(s): failed to resolve ref docker.io/library/nginx:latest: failed to do request: Head "https://registry-1.docker.io/v2/library/nginx/manifests/latest": dial tcp 54.227.20.253:443: i/o timeout
However, if I change the region to ap-southeast-2
, with exact configuration it works. I did quite a bit of research and found people get this issue if they don’t enable the public IP or if they try to start the task in private subnet without the NAT. In my case, I am starting the task in public subnet and has the public IP enabled.
I could not figure out the issue, I hope it is a region specific issue, but it seems AWS supports fargate in ap-southeast-1 as well. Any help will be highly appreciated. The strange thing is that if I specify env file from s3, it can’t pull it too. It means it should have some network issue. I am not being able to solve it.