diff --git a/changelogs/fragments/926-ec2_vpc_route_table.yml b/changelogs/fragments/926-ec2_vpc_route_table.yml new file mode 100644 index 00000000000..83c9f0e0ba1 --- /dev/null +++ b/changelogs/fragments/926-ec2_vpc_route_table.yml @@ -0,0 +1,2 @@ +minor_changes: +- ec2_vpc_route_table - add support for Carrier Gateway entry (https://github.com/ansible-collections/amazon.aws/pull/926). diff --git a/plugins/modules/ec2_vpc_route_table.py b/plugins/modules/ec2_vpc_route_table.py index d88defdeae2..9b2212b0a43 100644 --- a/plugins/modules/ec2_vpc_route_table.py +++ b/plugins/modules/ec2_vpc_route_table.py @@ -256,6 +256,12 @@ returned: when the route is via a NAT gateway type: str sample: local + carrier_gateway_id: + description: ID of the Carrier gateway. + returned: when the route is via a Carrier gateway + type: str + sample: local + version_added: 6.0.0 origin: description: mechanism through which the route is in the table. returned: always @@ -708,6 +714,8 @@ def create_route_spec(connection, module, vpc_id): route_spec['gateway_id'] = igw if route_spec.get('gateway_id') and route_spec['gateway_id'].startswith('nat-'): rename_key(route_spec, 'gateway_id', 'nat_gateway_id') + if route_spec.get('gateway_id') and route_spec['gateway_id'].startswith('cagw-'): + rename_key(route_spec, 'gateway_id', 'carrier_gateway_id') return snake_dict_to_camel_dict(routes, capitalize_first=True)