Skip to content

Conversation

@amogh09
Copy link
Contributor

@amogh09 amogh09 commented May 22, 2025

Summary

This PR makes the following two changes to task metadata returned for IPv6-only awsvpc mode tasks.

  1. A new SubnetGatewayIPV6Address field will be returned. Its value will be the subnet gateway IPv6 address used to create the default route for the task.
  2. Existing IPv6SubnetCIDRBlock field will be computed based on the actual subnet prefix length instead of the hardcoded /64 that is used for dual-stack tasks today.

Testing

IPv6-only subnet with /64 prefix -

ip-10-0-0-23 ❱ docker exec 6759f9efa687 sh -c 'curl -s $ECS_CONTAINER_METADATA_URI_V4' | jq '.Networks'
[
  {
    "NetworkMode": "awsvpc",
    "IPv6Addresses": [
      "2600:1f14:323a:e000:9233:2126:1e0f:ced1"
    ],
    "AttachmentIndex": 0,
    "MACAddress": "02:f2:3d:fe:5d:bb",
    "IPv6SubnetCIDRBlock": "2600:1f14:323a:e000::/64",
    "DomainNameServers": [
      "fd00:ec2::253"
    ],
    "DomainNameSearchList": [
      "us-west-2.compute.internal"
    ],
    "SubnetGatewayIPV6Address": "2600:1f14:323a:e000::1/64"
  }
]

IPv6-only subnet with /60 prefix -

ip-10-0-0-23 ❱ docker exec 6e086c5276d2 sh -c 'curl -s $ECS_CONTAINER_METADATA_URI_V4' | jq '.Networks'
[
  {
    "NetworkMode": "awsvpc",
    "IPv6Addresses": [
      "2600:1f14:323a:e014:588a:9986:158:b9ba"
    ],
    "AttachmentIndex": 0,
    "MACAddress": "02:5b:44:5e:c7:ef",
    "IPv6SubnetCIDRBlock": "2600:1f14:323a:e010::/60",
    "DomainNameServers": [
      "fd00:ec2::253"
    ],
    "DomainNameSearchList": [
      "us-west-2.compute.internal"
    ],
    "SubnetGatewayIPV6Address": "2600:1f14:323a:e010::1/60"
  }
]

Dual-stack subnet with /60 prefix (prefix gets hardcoded as /64 and SubnetGatewayIPv6Address is not populated) -

ip-10-0-0-23 ❱ docker exec 234da5144aea sh -c 'curl -s $ECS_CONTAINER_METADATA_URI_V4' | jq '.Networks'
[
  {
    "NetworkMode": "awsvpc",
    "IPv4Addresses": [
      "10.0.5.147"
    ],
    "IPv6Addresses": [
      "2600:1f14:323a:e023:170:b7b:3c6d:9a82"
    ],
    "AttachmentIndex": 0,
    "MACAddress": "02:b1:6e:6e:d3:17",
    "IPv4SubnetCIDRBlock": "10.0.5.0/24",
    "IPv6SubnetCIDRBlock": "2600:1f14:323a:e023::/64",
    "PrivateDNSName": "ip-10-0-5-147.us-west-2.compute.internal",
    "SubnetGatewayIpv4Address": "10.0.5.1/24"
  }
]

New tests cover the changes: yes

Description for the changelog

Enhancement: SubnetGatewayIPV6Address and IPv6SubnetCIDRBlock metadata for IPv6-only tasks

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?

No

Does this PR include the addition of new environment variables in the README?

No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amogh09 amogh09 force-pushed the ipv6-tmds-gateway branch from 1a4864c to 26240a4 Compare May 22, 2025 17:04
@amogh09 amogh09 changed the title SubnetGatewayIPV6Address and IPv6SubnetCIDRBlock metadata for IPv6-on… SubnetGatewayIPV6Address and IPv6SubnetCIDRBlock metadata for IPv6-only tasks May 22, 2025
@amogh09 amogh09 marked this pull request as ready for review May 22, 2025 20:17
@amogh09 amogh09 requested a review from a team as a code owner May 22, 2025 20:17
@amogh09 amogh09 merged commit 2c853a2 into aws:dev May 22, 2025
40 checks passed
xxx0624 pushed a commit to xxx0624/amazon-ecs-agent that referenced this pull request May 28, 2025
timj-hh pushed a commit to timj-hh/amazon-ecs-agent that referenced this pull request Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants