Summary
When you connect containers over IPv6, should you use PrivateLink, VPC Lattice or VPC endpoints? I was not sure either, so I put the same container behind all three paths and measured speed and security under the same conditions. The short answer: choose a path less by speed and more by whether the provider needs to know who is calling.
- Added latency was almost zero for PrivateLink (0.13 to 0.30 ms) and about 2 to 3 ms for VPC Lattice. Without connection reuse, though, every path pays about 2.3 to 2.6 ms more per request
- IPv6 and IPv4 performed the same within run-to-run variation. IPv6 is not the slow option
- Security groups do not apply to the S3 gateway endpoint. Policies are what protect it
This article is a deeper write-up of my English talk "IPv6-first container network design practices" at JAWS-UG Yamanashi #14 on November 21, 2026. It includes background and lessons that did not fit into the 20-minute slot. All numbers were measured in the Tokyo Region (ap-northeast-1) on November 19, 2026.
Who this is for
This is for engineers who connect containers on Amazon ECS or similar platforms across several VPCs or accounts. If every team owns its own VPC and you keep asking yourself how services should talk to each other, I hope this gives you something concrete to decide with.
It is also for teams that started thinking about IPv6 because of the public IPv4 charge. You may know the names PrivateLink and VPC Lattice but have never compared their actual speed or how you secure them. That is exactly the gap this article tries to fill.
What you will take away
By the end, you should be able to explain how to decide IPv6 per subnet tier and apply it to your own setup, without moving everything to IPv6-only at once.
You will also be able to explain the speed and security differences between the three paths with real numbers and raw logs. The article ends with a top-down checklist for choosing a path, which you can bring straight into a design review.
What this article covers (and what it does not)
| Covered | Not covered |
|---|---|
| Private service-to-service paths across VPCs in an IPv6-first design | IPv6 basics (address notation, subnetting) |
| Speed and security numbers and raw logs from my own lab | Internet egress design (NAT64, DNS64, egress-only internet gateway) |
| How to choose a path, and the settings used in the lab | Transit Gateway, EKS specifics, detailed pricing |
Internet egress and Transit Gateway matter a lot for IPv6 too, but each could fill an article of its own. Here I focus on private traffic between services.
Background
I assume you know VPC subnets, route tables and security groups, and Amazon ECS tasks. You will see the term "dual stack" (having both IPv4 and IPv6) many times.
Three changes made IPv6-first design realistic. In February 2024, public IPv4 addresses started to cost $0.005 per IP per hour. In September 2025, Amazon ECS added support for IPv6-only tasks and services. In November 2025, Amazon S3 gateway and interface VPC endpoints added IPv6 support. With all three in place, the question is no longer "can we use IPv6?" but "how do we design for it?"
Adding an IPv6 range to a VPC takes a few clicks. The hard part comes next: connecting services. When every team or account creates its own VPC, many of them end up with 10.0.0.0/16, and overlapping IPv4 ranges cannot simply be routed. AWS gives us three building blocks that work even when ranges overlap: PrivateLink, VPC endpoints for AWS services, and VPC Lattice. The documentation alone did not tell me which to pick, so I built a lab and measured.
Measuring the three paths
The lab
I deliberately gave both the consumer VPC and the provider VPC the same range, 10.0.0.0/16. There is no internet gateway and no NAT gateway, so the only way out is the path being measured. That way, nothing can quietly take another route.
On the provider side, the same container runs twice: one copy behind PrivateLink and an internal Network Load Balancer, the other behind VPC Lattice. On the consumer side, k6 runs on an EC2 instance and calls each path over IPv6. S3 is read through both a gateway endpoint and an interface endpoint.
The baseline is a direct call to the NLB from inside the provider VPC. Subtracting it shows only what each path adds. The lab is an AWS CDK app; I deployed the four stacks with cdkd in about 14 minutes (852 seconds) and deleted everything the same day.
Decide IPv6 per subnet tier
IPv6-first does not mean IPv6-only everywhere. My recommendation is to decide IPv6 per subnet tier rather than per VPC, because each tier has a different role and can move at its own pace.
The edge tier, with load balancers and endpoints, is called over both IPv4 and IPv6, so it stays dual stack. The workload tier starts dual stack too, and moves to IPv6-only once every dependency is reachable over IPv6. For that, I created dual-stack endpoints for ECR, CloudWatch Logs, Systems Manager and S3.
One real pitfall was the ec2messages endpoint. In the Tokyo Region it supports IPv4 only, and my deploy failed when I tried to create it as dual stack. Supported IP types differ by service and Region, so check before you create. I created only that endpoint as IPv4. SSM Agent 3.3.40 or later works with ssm and ssmmessages alone, so Session Manager still works on IPv6-only workloads.
How the three paths differ
Before the numbers, here is the mental model in one picture. All three let you call something outside your VPC from inside it, but they work at different layers and expose different things.
PrivateLink works at layer 4 and exposes one NLB port; the provider accepts each consumer. VPC endpoints use the same technology to reach AWS services, and the endpoint policy is the main control. VPC Lattice is a layer 7 application network with IAM authentication. Please keep the last row in mind: does the provider know who is calling? It drives both the security results and the final recommendation.
Speed 1: latency
First, latency with connection reuse at 500 requests per second over IPv6. The baseline median (p50) was 1.84 ms.
PrivateLink added only 0.13 to 0.30 ms. VPC Lattice added about 2.3 to 2.9 ms as an L7 proxy. Up to 1,000 requests per second, p99 did not get worse on any path. Across three runs the spread was small (PrivateLink 1.93 to 1.99 ms, Lattice HTTP 4.24 to 4.32 ms), so the roughly 2.3 ms gap comes from the path itself, not from noise.
Another finding from the report: with connection reuse, Lattice HTTPS was only 0.04 to 0.19 ms slower than HTTP. There is no reason to avoid TLS for performance, so I recommend HTTPS with Lattice too. A few milliseconds matter for chatty, latency-critical calls, where PrivateLink is a good fit. For most API calls, how you handle connections matters more, as the next result shows.
Speed 2: the cost of new connections
Next, the same test with a new connection for every request, which is what happens when an app does not reuse connections or runs as a short-lived process.
On PrivateLink, the TCP connect alone took 2.5 to 2.8 ms, because the handshake travels through the NLB to the task and back. VPC Lattice terminates TCP close to the client, so the connect took about 0.5 ms, but TLS added about 1.8 ms for HTTPS. In total, a new connection costs about 2.3 to 2.6 ms per request, as much as the gap between paths. Before debating paths, check that your app reuses connections.
One caveat when reading k6 results: http_req_duration does not include connect and TLS time, so it hides this cost. The report adds connect, TLS and request time together; at 300 requests per second the totals were 4.59 ms for PrivateLink and 6.63 ms for Lattice HTTPS, the same trend.
Speed 3: IPv6 vs IPv4
Is IPv6 slower? I measured the same paths over both protocols with the same load.
The p50 values were 2.01 vs 2.04 ms for PrivateLink, 4.24 vs 4.34 ms for Lattice, and 24.96 vs 24.75 ms for the S3 gateway endpoint. The differences of 0.03 to 0.21 ms were within run-to-run variation. VPC Flow Logs confirmed that the test traffic really used IPv6: about 3.16 GB over IPv6 versus about 36 MB over IPv4.
Speed 4: throughput and S3
I also checked throughput by fetching 1 MiB objects with 64 virtual users.
PrivateLink reached about 1,475 MiB/s, the network limit of the c7i.xlarge client (12.5 Gbps), even with two small 0.5 vCPU tasks. VPC Lattice leveled off around 1.1 GiB/s, and doubling the load only doubled latency. One run cannot tell whether that is a Lattice limit or a target-side limit, so I will retest with more and larger tasks. Also note that one-minute tests may use the instance's burst bandwidth, which is higher than its sustained baseline.
For S3, the gateway and interface endpoints had nearly the same p50, but p99 was 41 ms versus 57 ms in favor of the gateway endpoint. It has no extra charge and now supports IPv6, so I recommend it as the default for S3.
Speed 5: time to the first call
Speed is not only milliseconds. How long does a new team wait before its first successful call?
The S3 gateway endpoint was ready in 4 seconds and the interface endpoint in 247 seconds. The PrivateLink endpoint was created in 6 seconds and became available 38 seconds after the provider accepted it. The VPC Lattice VPC association took 74 seconds and needed no approval. On the provider side, the NLB took 127 seconds, the endpoint service 2 seconds, and the Lattice service and its association 10 seconds each.
On machine time alone PrivateLink wins, but a human approval is added in practice. And there is a trap that makes the wait much longer. If you resolve the PrivateLink DNS name before acceptance, the VPC resolver caches the negative answer. In my lab I accepted at 11:09:32 and the name resolved only at 11:19:16, about 584 seconds later. If a name resolves from outside but not from inside the VPC, suspect this, and check DNS only after the endpoint is available.
Security 1: think in layers
I tested security as three layers, so that one mistake does not open everything.
The network layer is the security group on the endpoint or the Lattice association. The connectivity layer is PrivateLink acceptance, the Lattice auth policy and endpoint policies for AWS services. The resource layer is, for example, an S3 bucket policy. I changed one condition at a time to see whether each layer really works.
Security 2: one change at a time
Same instance, same DNS name, one change per column: trusted, untrusted security group, PrivateLink not yet accepted, and Lattice with IAM required.
With an untrusted security group, PrivateLink, Lattice and the S3 interface endpoint all timed out. Before acceptance, the PrivateLink name did not even resolve. With IAM required on Lattice, unsigned calls got 403 and SigV4-signed calls got 200. In every case both VPCs kept the same 10.0.0.0/16 and all three paths worked. The PrivateLink endpoint service only allows my own account and requires acceptance.
The surprise was the S3 gateway endpoint: it still returned 200 with the untrusted security group, over both IPv6 and IPv4. The raw data explains why.
Raw data 1: where S3 traffic goes
Through the gateway endpoint, the client connected to public S3 addresses over both IPv6 and IPv4. Through the interface endpoint, it connected to the address of a network interface in my VPC. VPC Flow Logs marked the gateway traffic as traffic path 7. A gateway endpoint is a route in the route table, not a network interface. Security groups attach to network interfaces, so they cannot protect it. Use the endpoint policy and the bucket policy instead.
Raw data 2: the Lattice access log
With IAM required, unsigned calls were logged as 403 with authDeniedReason Service, so you can see why they were denied. Signed calls were logged as 200 together with the caller's IAM role. Before IAM was required, about 1.34 million anonymous calls were all logged with their source VPC. Getting this audit trail without touching your application is a real advantage; just remember to configure a log destination on the service network or service.
Security 3: what the provider sees
This was my favorite slide in the talk. What does the provider's container actually see about the caller?
Behind PrivateLink, the task sees only the NLB's IPv4 addresses (one per AZ) and cannot tell who called. Behind VPC Lattice, the x-amzn-source-vpc header shows the source VPC, and with SigV4 you also get the caller's IAM principal. If your provider must decide per caller, PrivateLink pushes that logic into your application, while Lattice hands it to you from the network. This is why I recommend choosing by caller identity rather than by speed alone.
Raw data 3: IPv6 in, IPv4 out
The client connected over IPv6, but the task received IPv4: the NLB's IPv4 address with PrivateLink, and a link-local IPv4 address with Lattice. With dual-stack workloads, IPv6 stops at the edge. A fun detail: the last 32 bits of the Lattice IPv6 address, a9fe:ab61, are 169.254.171.97 in decimal, exactly what the IPv4 lookup returned. For IPv6 end to end, the workload itself has to be IPv6-only.
Security 4: data perimeter
Even though an outside bucket allowed my endpoint, my endpoint policy did not list that bucket, so the request got 403. From the internet, the data bucket returned 403 because its policy only accepts requests through my endpoints. The endpoint policy controls where data can go; the bucket policy controls where requests can come from. Two policies facing opposite directions catch each other's mistakes, which matters most for the gateway endpoint.
Trade-offs
Every path has strengths and weaknesses. VPC Lattice tells you the caller but adds a few milliseconds and leveled off around 1.1 GiB/s for large objects. PrivateLink is fast, but you build caller identity yourself and wait for approval and DNS. The S3 gateway endpoint is free and stable but cannot use security groups. Rather than one path for everything, I recommend choosing per type of traffic.
About testing
I measured with k6 on a c7i.xlarge instance: 1 KiB responses, a 20-second warm-up, then one minute per load level. PrivateLink and Lattice ran three times in rotating order; the others ran once. All 59 runs had zero errors and zero dropped requests.
| Item | Condition |
|---|---|
| Region | ap-northeast-1 (November 19, 2026) |
| Load generator | k6 on c7i.xlarge (up to 12.5 Gbps) |
| Workload | ECS on Fargate, dual stack |
| Duration | One minute per load level; PrivateLink and Lattice three runs, others one |
I wrote down my expectations before measuring. Most held, and some held only with conditions. In particular, the cost of new HTTPS connections turned out to be about the same as the gap between paths, not larger.
| Expectation | Result |
|---|---|
| PrivateLink adds the least latency; Lattice adds L7 overhead | Confirmed |
| No meaningful difference between IPv6 and IPv4 | Confirmed |
| New HTTPS connections cost more than the difference between paths | Partly (about the same) |
| S3 gateway and interface endpoints have similar latency | Partly (gateway has better p99) |
| Lattice gets a new consumer connected fastest | Partly (reverses with human approval and DNS caching) |
| Only Lattice lets the provider decide per caller | Confirmed |
| An endpoint policy stops data going to another bucket | Confirmed |
Building the lab took four deploy attempts, and I fixed four issues along the way, adding tests to prevent regressions (from 30 to 32). The first deploy failed because a security group's IPv6 rule read the VPC's IPv6 range without waiting for it to be associated. Then came the ec2messages endpoint. A non-root k6 container could not write to a Fargate bind volume; I fixed it with a locked-down init container that keeps only the CHOWN capability and uses a read-only root file system. The last issue was the DNS negative cache described above.
Deploying took 852 seconds, switching the Lattice auth mode took about 27 seconds, and deleting took about 990 seconds with no leftover resources. These numbers come from short runs; please measure with your own workload before deciding. The code and the full report are in ContainerNetwork-Research-handson.
Real-world usage
Here are the key parts of the AWS CDK app used in the lab, written with aws-cdk-lib L1 constructs as of November 2026. L1 lets you set newer options such as ipAddressType and dnsOptions exactly as in CloudFormation.
First, dual-stack interface endpoints for dependencies, with ec2messages as the IPv4-only exception in the Tokyo Region.
// ec2messages does not support dual stack in ap-northeast-1 (as of November 2026)
const ipv4OnlyServices = new Set(['ec2messages']);
for (const [svc, logicalId] of services) {
const ipType = ipv4OnlyServices.has(svc) ? 'ipv4' : 'dualstack';
new ec2.CfnVPCEndpoint(this, logicalId, {
vpcId: vpc.ref,
serviceName: `com.amazonaws.${this.region}.${svc}`,
vpcEndpointType: 'Interface',
privateDnsEnabled: true,
ipAddressType: ipType,
dnsOptions: { dnsRecordIpType: ipType },
subnetIds: edgeSubnetIds,
securityGroupIds: [endpointSg.ref],
});
}
Next, an S3 gateway endpoint whose policy allows reading only the buckets you need. In a real environment, remember to also allow the buckets that hold ECR image layers and OS packages.
new ec2.CfnVPCEndpoint(this, 'S3GatewayEndpoint', {
vpcId: vpc.ref,
serviceName: `com.amazonaws.${this.region}.s3`,
vpcEndpointType: 'Gateway',
ipAddressType: 'dualstack',
routeTableIds: [rt.ref],
policyDocument: {
Version: '2012-10-17',
Statement: [{
Sid: 'DataBucketOnly',
Effect: 'Allow',
Principal: '*',
Action: 's3:GetObject',
Resource: `arn:${this.partition}:s3:::shop-data-${this.account}/*`,
}],
},
});
The data bucket only accepts reads through the two endpoints. A policy restricted with aws:SourceVpce is not treated as public by S3, so Block Public Access can stay on.
new s3.CfnBucketPolicy(this, 'DataBucketPolicy', {
bucket: dataBucket.ref,
policyDocument: {
Version: '2012-10-17',
Statement: [
{
Sid: 'ReadOnlyThroughConsumerEndpoints',
Effect: 'Allow',
Principal: '*',
Action: 's3:GetObject',
Resource: `${dataBucket.attrArn}/*`,
Condition: { StringEquals: { 'aws:SourceVpce': [s3GatewayEndpointId, s3InterfaceEndpoint.ref] } },
},
{
Sid: 'DenyInsecureTransport',
Effect: 'Deny',
Principal: '*',
Action: 's3:*',
Resource: [dataBucket.attrArn, `${dataBucket.attrArn}/*`],
Condition: { Bool: { 'aws:SecureTransport': 'false' } },
},
],
},
});
Finally, a VPC Lattice auth policy that allows only signed callers from this account coming from the consumer VPC. A coarser policy on the service network adds a second layer.
new lattice.CfnAuthPolicy(this, 'LatticeServiceAuthPolicy', {
resourceIdentifier: service.ref,
policy: {
Version: '2012-10-17',
Statement: [{
Sid: 'SignedCallersOfThisAccountFromConsumerVpc',
Effect: 'Allow',
Principal: '*',
Action: 'vpc-lattice-svcs:Invoke',
Resource: '*',
Condition: {
StringEquals: {
'vpc-lattice-svcs:SourceVpc': consumerVpcId,
'aws:PrincipalAccount': this.account,
},
StringNotEqualsIgnoreCase: { 'aws:PrincipalType': 'anonymous' },
},
}],
},
});
In operations, write security group rules for both IPv4 and IPv6; writing only one can block or allow traffic unexpectedly. Include pkt-srcaddr and traffic-path in VPC Flow Logs so you can later confirm which path and which IP version traffic actually used.
Wrap-up and what's next
- Decide IPv6 per subnet tier, and move workloads to IPv6-only after every dependency is reachable over IPv6
- Choose a path by what the provider needs to know about the caller, not only by speed
- Check connection reuse before comparing paths
- Protect the S3 gateway endpoint with two policies, because security groups do not apply
With IPv6-only ECS tasks and IPv6 for S3 VPC endpoints, AWS now has the pieces for IPv6-only workloads. As long as workloads stay dual stack, though, IPv6 stops at the edge. Next, I want to run the same tests with IPv6-only workloads, find out what limits Lattice throughput, and remeasure with five two-minute runs. I will write it up when it is done.
About the author
Ensemble Engineer (@mob_engineer) is the pen name of an SRE and project lead at a systems integration company. He works across AWS, Azure and OCI, with a particular interest in containers, virtual networking, and running observability with Dynatrace. Outside of work, he helps organize tech communities and conferences, and shares what he learns through talks and blog posts.
References
- JAWS-UG Yamanashi #14 event page (Japanese)
- ContainerNetwork-Research-handson: lab code and verification report
- New AWS Public IPv4 Address Charge and Public IP Insights (AWS News Blog)
- Amazon ECS IPv6-only support (What's New, September 2025)
- Amazon S3 IPv6 support for gateway and interface VPC endpoints (What's New, November 2025)



















Top comments (0)