Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ec2_vpc_route_table: Add support for Route entry for Carrier Gateway #926

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/926-ec2_vpc_route_table.yml
Original file line number Diff line number Diff line change
@@ -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).
8 changes: 8 additions & 0 deletions plugins/modules/ec2_vpc_route_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
mtulio marked this conversation as resolved.
Show resolved Hide resolved
mtulio marked this conversation as resolved.
Show resolved Hide resolved
version_added: 6.0.0
origin:
description: mechanism through which the route is in the table.
returned: always
Expand Down Expand Up @@ -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)

Expand Down