Skip to content

Commit

Permalink
Merge commit 'aa21e0a79f3a9da6b0a323071163440853051817' into stage-re…
Browse files Browse the repository at this point in the history
…lease-develop

* commit 'aa21e0a79f3a9da6b0a323071163440853051817':
  move enable-primary-ipv6 into network-interfaces if necessary
  • Loading branch information
aws-sdk-python-automation committed Aug 3, 2023
2 parents 9febc50 + aa21e0a commit 5d4f0f2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions awscli/customizations/ec2/runinstances.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def _fix_args(params, **kwargs):
if 'Ipv6Addresses' in params:
interface['Ipv6Addresses'] = params['Ipv6Addresses']
del params['Ipv6Addresses']
if 'EnablePrimaryIpv6' in params:
interface['PrimaryIpv6'] = params['EnablePrimaryIpv6']
del params['EnablePrimaryIpv6']


EVENTS = [
Expand Down
15 changes: 15 additions & 0 deletions tests/functional/ec2/test_run_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,18 @@ def test_ipv6_addresses_and_associate_public_ip_address(self):
'MinCount': 1
}
self.assert_run_instances_call(args, expected)

def test_enable_primary_ipv6_and_associate_public_ip_address(self):
args = ' --associate-public-ip-address'
args += ' --enable-primary-ipv6 --image-id ami-foobar --count 1'
expected = {
'NetworkInterfaces': [{
'DeviceIndex': 0,
'AssociatePublicIpAddress': True,
'PrimaryIpv6': True
}],
'ImageId': 'ami-foobar',
'MaxCount': 1,
'MinCount': 1
}
self.assert_run_instances_call(args, expected)

0 comments on commit 5d4f0f2

Please sign in to comment.