Skip to content

IPv6-only ECS fails to start (ECS registration API unreachable?)

0

TLDR: IPv6-Only ECS still does not work despite 9/29/25 announcement: https://aws.amazon.com/about-aws/whats-new/2025/09/amazon-ecs-ipv6-only-support/

ECS Container Instances Won't Register in IPv6-Only VPC (No NAT/VPC Endpoints)

Tags: ECS, IPv6, VPC, Networking

Problem

Deploying ECS with EC2 launch type in a pure IPv6-only VPC. EC2 instances launch successfully with IPv6 addresses but never register with the ECS cluster.

Error: No Container Instances were found in your cluster

Environment:

  • Region: us-west-2
  • VPC: IPv6-only (no IPv4 CIDR)
  • No NAT Gateway
  • No VPC Endpoints
  • Routing: ::/0 → Internet Gateway
  • Security Group: Allows all outbound to ::/0

CloudFormation Snippets

VPC with IPv6

Resources:
  VPC:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: 10.0.0.0/16
      EnableDnsHostnames: true
      EnableDnsSupport: true

  IPv6CidrBlock:
    Type: AWS::EC2::VPCCidrBlock
    Properties:
      VpcId: !Ref VPC
      AmazonProvidedIpv6CidrBlock: true

  PublicSubnet:
    Type: AWS::EC2::Subnet
    DependsOn: IPv6CidrBlock
    Properties:
      VpcId: !Ref VPC
      CidrBlock: 10.0.1.0/24
      Ipv6CidrBlock: !Select [0, !Cidr [!Select [0, !GetAtt VPC.Ipv6CidrBlocks], 256, 64]]
      AssignIpv6AddressOnCreation: true

  InternetGateway:
    Type: AWS::EC2::InternetGateway

  AttachGateway:
    Type: AWS::EC2::VPCGatewayAttachment
    Properties:
      VpcId: !Ref VPC
      InternetGatewayId: !Ref InternetGateway

  PublicRouteIPv6:
    Type: AWS::EC2::Route
    Properties:
      RouteTableId: !Ref PublicRouteTable
      DestinationIpv6CidrBlock: '::/0'
      GatewayId: !Ref InternetGateway

Security Group (IPv6 Outbound)

  ECSSecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Security group for ECS instances (IPv6-only)
      VpcId: !Ref VPC
      SecurityGroupEgress:
        - IpProtocol: -1
          CidrIpv6: '::/0'  # Allow ALL outbound IPv6

ECS Launch Template

  LaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties:
      LaunchTemplateData:
        ImageId: !Sub '{{resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id}}'
        InstanceType: t3.small
        IamInstanceProfile:
          Arn: !GetAtt EC2InstanceProfile.Arn
        SecurityGroupIds:
          - !Ref ECSSecurityGroup
        UserData:
          Fn::Base64: !Sub |
            #!/bin/bash
            echo ECS_CLUSTER=${ECSCluster} >> /etc/ecs/ecs.config

Verification

Instance has IPv6:

$ aws ec2 describe-instances --instance-ids i-06ded2efc3c7b567e \
    --query 'Reservations[0].Instances[0].Ipv6Address'
"2600:1f14:8e6:c800:7a1f:f35a:2866:29fc"  ✓

But cluster has no instances:

$ aws ecs list-container-instances --cluster ecs-ipv6-demo-cluster
{"containerInstanceArns": []}  ✗

ECS service events:

$ aws ecs describe-services --cluster ecs-ipv6-demo-cluster \
    --services ecs-ipv6-demo-service --query 'services[0].events[0].message'

"(service ecs-ipv6-demo-service) was unable to place a task because
no container instance met all of its requirements. The reason for
failure is No Container Instances were found in your cluster."

Root Cause Discovery

ECS endpoints don't support IPv6:

# From the IPv6-only EC2 instance:
$ dig +short AAAA ecs.us-west-2.amazonaws.com
(empty)  # NO IPv6 addresses

$ dig +short A ecs.us-west-2.amazonaws.com
52.94.foo.bar  # IPv4 only

ECS Agent logs (/var/log/ecs/ecs-agent.log):

level=error msg="Unable to register as a container instance with ECS"
level=error msg="Post https://ecs.us-west-2.amazonaws.com/: dial tcp:
lookup ecs.us-west-2.amazonaws.com: no suitable address found"

The Problem

Instance has ONLY IPv6 → ECS API is ONLY IPv4 → Cannot connect

Questions

  1. Do ECS service endpoints support IPv6 in ANY region?
  2. Is IPv6-only ECS possible without VPC Endpoints or NAT Gateway?
  3. Why doesn't AWS documentation mention this incompatibility?

AWS promotes IPv6-only VPCs for cost savings (no NAT Gateway), but this appears fundamentally incompatible with ECS.

Workarounds (Both Add Cost)

  1. VPC Endpoints: Add Interface endpoints for ECS, ECR, S3 (~$21/month)
  2. Dual-stack + NAT: Add NAT Gateway for IPv4 outbound (~$32/month)

Both defeat the purpose of IPv6-only cost optimization.

Expected Behavior

Either:

  • ECS endpoints should support IPv6 (AAAA records), OR
  • Documentation should clearly state ECS requires VPC Endpoints or NAT in IPv6-only VPCs

Has anyone successfully deployed IPv6-only ECS without VPC Endpoints or NAT Gateway?


Environment: ECS-Optimized Amazon Linux 2, t3.small, us-west-2 IAM Role: AmazonEC2ContainerServiceforEC2Role attached Network: Verified IPv6 connectivity via IGW works (can ping6 external hosts)

asked a year ago275 views

2 Answers
0

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:

  1. For ECS tasks to be assigned IPv6 addresses, you need:
  • EC2 Linux instances running container agent version 1.45.0 or later
  • The dualStackIPv6 account setting enabled
  • Tasks using the awsvpc network mode
  • VPC and subnet properly configured for IPv6
  1. 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:

  1. Add VPC endpoints for the required services (ECS, ECR, S3)
  2. 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

answered a year ago

AWS
SUPPORT ENGINEER

reviewed a year ago

0

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

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.