ansible-collections / amazon.aws

Ansible Collection for Amazon AWS
GNU General Public License v3.0
308 stars 338 forks source link

ec2_vpc_route_table should support IPv6 routes #768

Open vonschultz opened 2 years ago

vonschultz commented 2 years ago

Summary

When trying to add e.g. the default route for IPv6, ::/0, it complains that's not a valid CIDR. When IPv6 routes are already in place, it produces warnings saying

[WARNING]: Skipping purging route {'DestinationIpv6CidrBlock': '::/0', 'GatewayId': 'igw-0cf0f83e528bb6fe2', 'Origin': 'CreateRoute', 'State': 'active'} because it has no destination cidr block. To remove VPC endpoints from route tables use the ec2_vpc_endpoint module.

community.aws.ec2_vpc_route_table should support IPv6 routes, and gracefully handle any IPv6 routes that are already there.

Issue Type

Feature Idea

Component Name

ec2_vpc_route_table

Additional Information

No response

Code of Conduct

ansibullbot commented 2 years ago

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

tremble commented 2 years ago

Hi @vonschultz,

Thanks for taking the time to raise this issue. IPv6 support was added by https://github.com/ansible-collections/amazon.aws/pull/601 and should be available with release 3.1.0 of amazon.aws.

ansibullbot commented 2 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 2 years ago

cc @jillr @s-hertel @willthames click here for bot help

vonschultz commented 2 years ago

Ah, nice!

vonschultz commented 1 year ago

I've now upgraded to amazon.aws release 5.2.0, and the warning is still produced, though it no longer refers to ::/0. The warning I get is

[WARNING]: Skipping purging route {'DestinationIpv6CidrBlock': '2a05:d016:e04:a400::/56', 'GatewayId': 'local', 'Origin': 'CreateRouteTable', 'State': 'active'} because it has no destination cidr block. To remove VPC endpoints from route tables use the ec2_vpc_endpoint module.

I see the corresponding code in main, https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/ec2_vpc_route_table.py, function ensure_routes(), the if purge_routes branch.

I'm fine with skipping purging this route, as the GatewayId is local and the DestinationIpv6CidrBlock is the CIDR block of the VPC itself, but the warning is strange, since there is a destination CIDR block, and this is entirely unrelated to VPC endpoints.