- Newest
- Most votes
- Most comments
The issue you're experiencing with ECS container instances not registering in an IPv6-only VPC is related to AWS service endpoint compatibility with IPv6.
Currently, Amazon ECS tasks can work in an IPv6-only configuration, but there are specific requirements and limitations:
- For ECS tasks to be assigned IPv6 addresses, you need:
- EC2 Linux instances running container agent version 1.45.0 or later
- The
dualStackIPv6account setting enabled - Tasks using the
awsvpcnetwork mode - VPC and subnet properly configured for IPv6
- For IPv6-only ECS configurations:
- Amazon ECS workloads in IPv6-only configurations must use Amazon ECR dualstack image URI endpoints when pulling images
- DNS64 and NAT64 may be needed for communication with IPv4-only endpoints
- ECS Exec is not supported in IPv6-only configurations
The root cause of your specific issue is that the ECS service endpoints themselves don't fully support IPv6 connectivity. When your EC2 instances try to register with the ECS cluster, they need to communicate with the ECS API endpoints, which appear to only have IPv4 addresses available.
This creates a fundamental connectivity issue: your IPv6-only instances cannot reach the IPv4-only ECS endpoints without some form of translation or dual-stack connectivity.
Your identified workarounds are correct:
- Add VPC endpoints for the required services (ECS, ECR, S3)
- Use a dual-stack VPC with NAT Gateway for IPv4 outbound traffic
While AWS has been expanding IPv6 support across services, there are still gaps in full IPv6-only compatibility for some services, including aspects of ECS. The container agent needs to communicate with AWS endpoints, and if those endpoints don't support IPv6, you'll need one of the translation mechanisms mentioned above.
For a true IPv6-only ECS deployment without additional components like NAT gateways, AWS would need to provide IPv6 support for all the required service endpoints that the ECS agent communicates with.
Sources
Amazon ECS task networking options for EC2 - Amazon Elastic Container Service
Allocate a network interface for an Amazon ECS task - Amazon Elastic Container Service
I would say it does provide cost benefits if you are running more than 6 instances (~ $21.6/month = 0.005/hr * 24 hours * 30 days * 6 instances ]). Most enterprise setup would eventually have more than 6 instances, so for now it makes sense to use IPv6 and have VPC endpoints. Though data is also charged for endpoints. But, I guess you won't be transferring a lot of data $0.01/per GB which is again far lower than NAT gateway data transfer charges.
answered 6 months ago
Relevant content
asked 16 days ago
