I have task definition which uses AWS_VPC
mode.
My environment is like this,
EC2 (on private with nat subnet) -> ECS Service -> Container (with AWS_VPC)
However, from container, I can't connect to the http://169.254.169.254
to get the EC2 information.
If I changed the mode to HOST
, it can connect to the http://169.254.169.254
How can I fix this?
Use the ECS Task Metadata Endpoint from within your containers, instead of trying to use the EC2 Instance Metadata Endpoint.