mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #25326 from rallytime/bp-20972
Back-port #20972 to 2015.5
This commit is contained in:
commit
b0196fccb7
1 changed files with 12 additions and 2 deletions
|
@ -1165,8 +1165,7 @@ def _create_eni(interface):
|
|||
'No such subnet <{0}>'.format(interface['SubnetId'])
|
||||
)
|
||||
|
||||
params = {'Action': 'CreateNetworkInterface',
|
||||
'SubnetId': interface['SubnetId']}
|
||||
params = {'SubnetId': interface['SubnetId']}
|
||||
|
||||
for k in ('Description', 'PrivateIpAddress',
|
||||
'SecondaryPrivateIpAddressCount'):
|
||||
|
@ -1177,6 +1176,17 @@ def _create_eni(interface):
|
|||
if k in interface:
|
||||
params.update(_param_from_config(k, interface[k]))
|
||||
|
||||
if 'AssociatePublicIpAddress' in interface:
|
||||
# Associating a public address in a VPC only works when the interface is not
|
||||
# created beforehand, but as a part of the machine creation request.
|
||||
for k in ('DeviceIndex', 'AssociatePublicIpAddress', 'NetworkInterfaceId'):
|
||||
if k in interface:
|
||||
params[k] = interface[k]
|
||||
params['DeleteOnTermination'] = interface.get('delete_interface_on_terminate', True)
|
||||
return params
|
||||
|
||||
params['Action'] = 'CreateNetworkInterface'
|
||||
|
||||
result = aws.query(params,
|
||||
return_root=True,
|
||||
location=get_location(),
|
||||
|
|
Loading…
Add table
Reference in a new issue