Repository: ansible/ansible

Issue:
ec2_vpc_vgw BGP AS numbers
##### ISSUE TYPE
 - Feature Idea

##### COMPONENT NAME
ec2_vpc_vgw

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
$ ansible --version
ansible 2.5.0
  config file = /Users/johndoe/.ansible.cfg
  configured module search path = [u'/Library/Python/2.7/site-packages/napalm_ansible/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
```

##### CONFIGURATION
<!---
$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/Users/johndoe/.ansible.cfg) = [u'/Users/johndoe/repos/ansible/inventory']
DEFAULT_LOG_PATH(/Users/johndoe/.ansible.cfg) = /Users/johndoe/.ansible.log
DEFAULT_MANAGED_STR(/Users/johndoe/.ansible.cfg) = Ansible managed: modified on %Y-%m-%d by {uid} on {host}
DEFAULT_MODULE_PATH(/Users/johndoe/.ansible.cfg) = [u'/Library/Python/2.7/site-packages/napalm_ansible/modules']
DEFAULT_VAULT_PASSWORD_FILE(/Users/johndoe/.ansible.cfg) = /Users/johndoe/.ssh/vault
-->

##### OS / ENVIRONMENT
<!---
N/A
-->

##### SUMMARY
Make the module support setting non AWS standard BGP AS numbers.



Discussion:
Files identified in the description:
* [lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py)

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](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @naslanidis @willthames
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
--- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
+++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw.py
@@ -41,6 +41,10 @@
   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(
@@ -526,6 +532,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']),


Test patch: