AWS ECS IPv6 Support

This commit is contained in:
Marcus Speight 2025-10-23 09:00:05 +01:00 committed by GitHub
parent d6598f370c
commit c50216919a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -317,8 +317,14 @@ func (p *Provider) listInstances(ctx context.Context, client *awsClient) ([]ecsI
protocol: mapping.Protocol,
})
}
privateIP := aws.ToString(container.NetworkInterfaces[0].PrivateIpv4Address)
if privateIP == "" {
privateIP = aws.ToString(container.NetworkInterfaces[0].Ipv6Address)
}
mach = &machine{
privateIP: aws.ToString(container.NetworkInterfaces[0].PrivateIpv4Address),
privateIP: privateIP,
ports: ports,
state: ec2types.InstanceStateName(strings.ToLower(aws.ToString(task.LastStatus))),
healthStatus: task.HealthStatus,