From 90aa68be41d280b7337972d42b916912b4b42573 Mon Sep 17 00:00:00 2001 From: ossark Date: Fri, 25 May 2018 20:17:18 +0200 Subject: [PATCH] Fixes #38484 (#38522) * Fixes #38484 * Makes asn optional --- lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py index c6890a4e928..7be706269e6 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py @@ -41,6 +41,10 @@ options: vpc_id: description: - the vpc-id of a vpc to attach or detach + asn: + description: + - the BGP ASN of the amazon side + version_added: "2.6" wait_timeout: description: - number of seconds to wait for status during vpc attach and detach @@ -203,9 +207,11 @@ def detach_vgw(client, module, vpn_gateway_id, vpc_id=None): def create_vgw(client, module): params = dict() params['Type'] = module.params.get('type') + if module.params.get('asn'): + params['AmazonSideAsn'] = module.params.get('asn') try: - response = client.create_vpn_gateway(Type=params['Type']) + response = client.create_vpn_gateway(**params) get_waiter( client, 'vpn_gateway_exists' ).wait( @@ -528,6 +534,7 @@ def main(): name=dict(), vpn_gateway_id=dict(), vpc_id=dict(), + asn=dict(type='int'), wait_timeout=dict(type='int', default=320), type=dict(default='ipsec.1', choices=['ipsec.1']), tags=dict(default=None, required=False, type='dict', aliases=['resource_tags']),