issue 39642 - boto_vpc.nat_gateway_present should accept parameter allocation_id.

This commit is contained in:
Drew Malone 2017-02-24 08:58:37 -05:00
parent 0d31201e08
commit 56d9adfbf6

View file

@ -1279,7 +1279,7 @@ def route_table_absent(name, region=None,
def nat_gateway_present(name, subnet_name=None, subnet_id=None,
region=None, key=None, keyid=None, profile=None):
region=None, key=None, keyid=None, profile=None, allocation_id=None):
'''
Ensure a nat gateway exists within the specified subnet
@ -1304,6 +1304,10 @@ def nat_gateway_present(name, subnet_name=None, subnet_id=None,
Id of the subnet within which the nat gateway should exist.
Either subnet_name or subnet_id must be provided.
allocation_id
If specified, the elastic IP address referenced by the ID is
associated with the gateway. Otherwise, a new allocation_id is created and used.
region
Region to connect to.
@ -1337,7 +1341,8 @@ def nat_gateway_present(name, subnet_name=None, subnet_id=None,
r = __salt__['boto_vpc.create_nat_gateway'](subnet_name=subnet_name,
subnet_id=subnet_id,
region=region, key=key,
keyid=keyid, profile=profile)
keyid=keyid, profile=profile,
allocation_id=allocation_id)
if not r.get('created'):
ret['result'] = False
ret['comment'] = 'Failed to create nat gateway: {0}.'.format(r['error']['message'])