- Newest
- Most votes
- Most comments
I've answered my question. Yes, using a "dualstack" configuration means assigning a public IPv4 address in addition to the IPv6 address. This is ultimately the route I went down, and once CodeDeploy is made to work with IPv6 only, I will remove the IPv4 and things should continue to work.
The NAT Gateway w/ NAT64 and DNS64 functionality solution is relatively expensive compared to using public IPv4 addresses.
answered a year ago
The issue you're experiencing is because the AWS CodeDeploy agent does not currently support IPv6 communication. Even though you've set up your VPC with IPv6 addresses and have an internet gateway configured, the CodeDeploy agent can only communicate over IPv4.
To resolve this issue, you need to configure your instances to use both IPv4 and IPv6 addresses (dual-stack mode). This will allow the CodeDeploy agent to communicate over IPv4 while the rest of your application can use IPv6 addresses.
The error message you're seeing indicates that the CodeDeploy agent is trying to connect to the CodeDeploy service endpoint (codedeploy-commands.us-west-1.amazonaws.com) but is unable to establish a connection because it's attempting to use IPv6 while the agent only supports IPv4.
For IPv6-only instances that need to communicate with IPv4-only destinations (like the CodeDeploy service), you would typically need to implement NAT64 and DNS64 functionality using an Amazon VPC NAT Gateway. This allows IPv6-only instances to communicate with IPv4-only destinations by translating IPv6 packets to IPv4 and synthesizing AAAA records for IPv4-only destinations.
However, in this specific case, the simplest solution is to assign a public IPv4 address to your EC2 instance or use a dual-stack configuration to allow the CodeDeploy agent to function properly.
Sources
Migration issue from ipv4 to ipv6 | AWS re:Post
EC2 instances cannot reach IPv4 in dualstack VPC | AWS re:Post
answered a year ago
Relevant content
asked 2 years ago
asked 4 years ago
- AWS OFFICIALUpdated a year ago

Does using a dualstack configuration mean assigning both a public IPv4 and public IPv6 address at the same time? Or is it not about having a public IPv4 and my EC2 instance just needs a private IPv4? I thought it had one by default but I'm not very competent in network configuration.