Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add IPv6SubnetCIDRBlock for awsvpc task in task metadata #2596

Merged
merged 1 commit into from
Aug 28, 2020
Merged

add IPv6SubnetCIDRBlock for awsvpc task in task metadata #2596

merged 1 commit into from
Aug 28, 2020

Conversation

cyastella
Copy link
Contributor

Summary

add IPv6SubnetCIDRBlock for awsvpc task in v4 task metadata endpoint.

Implementation details

add IPv6SubnetCIDRBlock field in the NetworkInterfaceProperties in the task response.
the sample output looks like:

# curl $ECS_CONTAINER_METADATA_URI_V4  
  "DockerId": "24839d2d1f3a4e68d3ffb653aa5f7f83c5a51c71b8ae906289ab4910a36b8e6a",
  "Name": "container_1",
  "DockerName": "ecs-test-ipv6-manual-nc-1-container1-a285bfd6caa0a2879001",
  "Image": "nginx:latest",
  "ImageID": "sha256:4bb46517cac397bdb0bab6eba09b0e1f8e90ddd17cf99662997c3253531136f8",
  "Labels": {
    "com.amazonaws.ecs.cluster": "default",
    "com.amazonaws.ecs.container-name": "container_1",
    "com.amazonaws.ecs.task-arn": "arn:aws:ecs:us-east-1:984736093387:task/5f1dd5f6-ce11-46ff-b66e-deb9c19acd2e",
    "com.amazonaws.ecs.task-definition-family": "test-ipv6-manual-nc",
    "com.amazonaws.ecs.task-definition-version": "1"
  },
  "DesiredStatus": "RUNNING",
  "KnownStatus": "RUNNING",
  "Limits": {
    "CPU": 100,
    "Memory": 512
  },
  "CreatedAt": "2020-08-27T06:19:40.872815389Z",
  "StartedAt": "2020-08-27T06:19:42.113141252Z",
  "Type": "NORMAL",
  "Networks": [
    {
      "NetworkMode": "awsvpc",
      "IPv4Addresses": [
        "10.0.0.181"
      ],
      "IPv6Addresses": [
        "2600:1f18:619e:f900:8467:78b2:81c4:207d"
      ],
      "AttachmentIndex": 0,
      "MACAddress": "06:77:30:25:b8:63",
      "IPv4SubnetCIDRBlock": "10.0.0.0/24",
      "IPv6SubnetCIDRBlock": "2600:1f18:619e:f900::/64",
      "SubnetGatewayIpv4Address": "10.0.0.1/24"
    }
  ]
}

Testing

curl Ipv4 address: 10.0.0.181
curl Ipv6 address : "http://[2600:1f18:619e:f900:8467:78b2:81c4:207d]/"
both successfully with the following messages:

curl "http://\[2600:1f18:619e:f900:8467:78b2:81c4:207d\]/"
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

New tests cover the changes:

Description for the changelog

Licensing

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

@cyastella cyastella merged commit e1de982 into aws:ipv6 Aug 28, 2020
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