We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
--private-ip-address option at run-instances does not work 
I think --private-ip-address option can accept private ip address to assign.
but when I ran the command as follows,  

> aws ec2 run-instances \
>   --image-id ami-b1fe9bb0 \
>   --subnet-id subnet-00xxxxxx \
>   --key-name keypair1 \
>   --security-group-ids sg-yyyyyy \
>   --region ap-northeast-1 \
>   --instance-type t1.micro \
>   --associate-public-ip-address \
>   --private-ip-address 10.0.0.222 \
>   --debug

Error message was show as follows.

> ClientError: A client error (InvalidParameterCombination) occurred: Network interfaces and an instance-level private IP address may not be specified on the same request

On the other hand, when executed same command by ec2-api-tools, it worked fine.

Bellow is the differences in API request between awscli and ec2-api-tools

ec2-api-tools

> NetworkInterface.1.PrivateIpAddresses.1.Primary=true&
> NetworkInterface.1.PrivateIpAddresses.1.PrivateIpAddress=10.0.0.222&

awscli

> PrivateIpAddress=10.0.0.222&

This seems to be same as #504.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `awscli/customizations/ec2runinstances.py`
Content:
```
1 # Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"). You
4 # may not use this file except in compliance with the License. A copy of
5 # the License is located at
6 #
7 #     http://aws.amazon.com/apache2.0/
8 #
9 # or in the "license" file accompanying this file. This file is
10 # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11 # ANY KIND, either express or implied. See the License for the specific
12 # language governing permissions and limitations under the License.
13 """
14 This customization adds two new parameters to the ``ec2 run-instance``
15 command.  The first, ``--secondary-private-ip-addresses`` allows a list
16 of IP addresses within the specified subnet to be associated with the
17 new instance.  The second, ``--secondary-ip-address-count`` allows you
18 to specify how many additional IP addresses you want but the actual
19 address will be assigned for you.
20 
21 This functionality (and much more) is also available using the
22 ``--network-interfaces`` complex argument.  This just makes two of
23 the most commonly used features available more easily.
24 """
25 from awscli.arguments import CustomArgument
26 
27 # --secondary-private-ip-address
28 SECONDARY_PRIVATE_IP_ADDRESSES_DOCS = (
29     '[EC2-VPC] A secondary private IP address for the network interface '
30     'or instance. You can specify this multiple times to assign multiple '
31     'secondary IP addresses.  If you want additional private IP addresses '
32     'but do not need a specific address, use the '
33     '--secondary-private-ip-address-count option.')
34 
35 # --secondary-private-ip-address-count
36 SECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS = (
37     '[EC2-VPC] The number of secondary IP addresses to assign to '
38     'the network interface or instance.')
39 
40 # --associate-public-ip-address
41 ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS = (
42     '[EC2-VPC] If specified a public IP address will be assigned '
43     'to the new instance in a VPC.')
44 
45 def _add_params(argument_table, operation, **kwargs):
46     arg = SecondaryPrivateIpAddressesArgument(
47         name='secondary-private-ip-addresses',
48         help_text=SECONDARY_PRIVATE_IP_ADDRESSES_DOCS)
49     argument_table['secondary-private-ip-addresses'] = arg
50     arg = SecondaryPrivateIpAddressCountArgument(
51         name='secondary-private-ip-address-count',
52         help_text=SECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS)
53     argument_table['secondary-private-ip-address-count'] = arg
54     arg = AssociatePublicIpAddressArgument(
55         name='associate-public-ip-address',
56         help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS,
57         action='store_true', group_name='associate_public_ip')
58     argument_table['associate-public-ip-address'] = arg
59     arg = NoAssociatePublicIpAddressArgument(
60         name='no-associate-public-ip-address',
61         help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS,
62         action='store_false', group_name='associate_public_ip')
63     argument_table['no-associate-public-ip-address'] = arg
64 
65 
66 def _check_args(parsed_args, **kwargs):
67     # This function checks the parsed args.  If the user specified
68     # the --network-interfaces option with any of the scalar options we
69     # raise an error.
70     arg_dict = vars(parsed_args)
71     if arg_dict['network_interfaces']:
72         for key in ('secondary_private_ip_addresses',
73                     'secondary_private_ip_address_count',
74                     'associate_public_ip_address'):
75             if arg_dict[key]:
76                 msg = ('Mixing the --network-interfaces option '
77                        'with the simple, scalar options is '
78                        'not supported.')
79                 raise ValueError(msg)
80 
81 
82 def _fix_args(operation, endpoint, params, **kwargs):
83     # The RunInstances request provides some parameters
84     # such as --subnet-id and --security-group-id that can be specified
85     # as separate options only if the request DOES NOT include a
86     # NetworkInterfaces structure.  In those cases, the values for
87     # these parameters must be specified inside the NetworkInterfaces
88     # structure.  This function checks for those parameters
89     # and fixes them if necessary.
90     # NOTE: If the user is a default VPC customer, RunInstances
91     # allows them to specify the security group by name or by id.
92     # However, in this scenario we can only support id because
93     # we can't place a group name in the NetworkInterfaces structure.
94     if 'network_interfaces' in params:
95         ni = params['network_interfaces']
96         if 'AssociatePublicIpAddress' in ni[0]:
97             if 'subnet_id' in params:
98                 ni[0]['SubnetId'] = params['subnet_id']
99                 del params['subnet_id']
100             if 'security_group_ids' in params:
101                 ni[0]['Groups'] = params['security_group_ids']
102                 del params['security_group_ids']
103 
104 
105 EVENTS = [
106     ('building-argument-table.ec2.run-instances', _add_params),
107     ('operation-args-parsed.ec2.run-instances', _check_args),
108     ('before-parameter-build.ec2.RunInstances', _fix_args),
109     ]
110 
111 
112 def register_runinstances(event_handler):
113     # Register all of the events for customizing BundleInstance
114     for event, handler in EVENTS:
115         event_handler.register(event, handler)
116 
117 
118 def _build_network_interfaces(params, key, value):
119     # Build up the NetworkInterfaces data structure
120     if 'network_interfaces' not in params:
121         params['network_interfaces'] = [{'DeviceIndex': 0}]
122 
123     if key == 'PrivateIpAddresses':
124         if 'PrivateIpAddresses' not in params['network_interfaces'][0]:
125             params['network_interfaces'][0]['PrivateIpAddresses'] = value
126     else:
127         params['network_interfaces'][0][key] = value
128 
129 
130 class SecondaryPrivateIpAddressesArgument(CustomArgument):
131 
132     def add_to_parser(self, parser, cli_name=None):
133         parser.add_argument(self.cli_name, dest=self.py_name,
134                             default=self._default, nargs='*')
135 
136     def add_to_params(self, parameters, value):
137         if value:
138             value = [{'PrivateIpAddress': v, 'Primary': False} for
139                      v in value]
140             _build_network_interfaces(parameters,
141                                       'PrivateIpAddresses',
142                                       value)
143 
144 
145 class SecondaryPrivateIpAddressCountArgument(CustomArgument):
146 
147     def add_to_parser(self, parser, cli_name=None):
148         parser.add_argument(self.cli_name, dest=self.py_name,
149                             default=self._default, type=int)
150 
151     def add_to_params(self, parameters, value):
152         if value:
153             _build_network_interfaces(parameters,
154                                       'SecondaryPrivateIpAddressCount',
155                                       value)
156 
157 
158 class AssociatePublicIpAddressArgument(CustomArgument):
159 
160     def add_to_params(self, parameters, value):
161         if value is True:
162             _build_network_interfaces(parameters,
163                                       'AssociatePublicIpAddress',
164                                       value)
165 
166 
167 class NoAssociatePublicIpAddressArgument(CustomArgument):
168 
169     def add_to_params(self, parameters, value):
170         if value is False:
171             _build_network_interfaces(parameters,
172                                       'AssociatePublicIpAddress',
173                                       value)
174
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/awscli/customizations/ec2runinstances.py b/awscli/customizations/ec2runinstances.py
--- a/awscli/customizations/ec2runinstances.py
+++ b/awscli/customizations/ec2runinstances.py
@@ -100,6 +100,11 @@
             if 'security_group_ids' in params:
                 ni[0]['Groups'] = params['security_group_ids']
                 del params['security_group_ids']
+            if 'private_ip_address' in params:
+                ip_addr = {'PrivateIpAddress': params['private_ip_address'],
+                           'Primary': True}
+                ni[0]['PrivateIpAddresses'] = [ip_addr]
+                del params['private_ip_address']
 
 
 EVENTS = [

{"golden_diff": "diff --git a/awscli/customizations/ec2runinstances.py b/awscli/customizations/ec2runinstances.py\n--- a/awscli/customizations/ec2runinstances.py\n+++ b/awscli/customizations/ec2runinstances.py\n@@ -100,6 +100,11 @@\n             if 'security_group_ids' in params:\n                 ni[0]['Groups'] = params['security_group_ids']\n                 del params['security_group_ids']\n+            if 'private_ip_address' in params:\n+                ip_addr = {'PrivateIpAddress': params['private_ip_address'],\n+                           'Primary': True}\n+                ni[0]['PrivateIpAddresses'] = [ip_addr]\n+                del params['private_ip_address']\n \n \n EVENTS = [\n", "issue": "--private-ip-address option at run-instances does not work \nI think --private-ip-address option can accept private ip address to assign.\nbut when I ran the command as follows,  \n\n> aws ec2 run-instances \\\n>   --image-id ami-b1fe9bb0 \\\n>   --subnet-id subnet-00xxxxxx \\\n>   --key-name keypair1 \\\n>   --security-group-ids sg-yyyyyy \\\n>   --region ap-northeast-1 \\\n>   --instance-type t1.micro \\\n>   --associate-public-ip-address \\\n>   --private-ip-address 10.0.0.222 \\\n>   --debug\n\nError message was show as follows.\n\n> ClientError: A client error (InvalidParameterCombination) occurred: Network interfaces and an instance-level private IP address may not be specified on the same request\n\nOn the other hand, when executed same command by ec2-api-tools, it worked fine.\n\nBellow is the differences in API request between awscli and ec2-api-tools\n\nec2-api-tools\n\n> NetworkInterface.1.PrivateIpAddresses.1.Primary=true&\n> NetworkInterface.1.PrivateIpAddresses.1.PrivateIpAddress=10.0.0.222&\n\nawscli\n\n> PrivateIpAddress=10.0.0.222&\n\nThis seems to be same as #504.\n\n", "before_files": [{"content": "# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n#     http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n\"\"\"\nThis customization adds two new parameters to the ``ec2 run-instance``\ncommand.  The first, ``--secondary-private-ip-addresses`` allows a list\nof IP addresses within the specified subnet to be associated with the\nnew instance.  The second, ``--secondary-ip-address-count`` allows you\nto specify how many additional IP addresses you want but the actual\naddress will be assigned for you.\n\nThis functionality (and much more) is also available using the\n``--network-interfaces`` complex argument.  This just makes two of\nthe most commonly used features available more easily.\n\"\"\"\nfrom awscli.arguments import CustomArgument\n\n# --secondary-private-ip-address\nSECONDARY_PRIVATE_IP_ADDRESSES_DOCS = (\n    '[EC2-VPC] A secondary private IP address for the network interface '\n    'or instance. You can specify this multiple times to assign multiple '\n    'secondary IP addresses.  If you want additional private IP addresses '\n    'but do not need a specific address, use the '\n    '--secondary-private-ip-address-count option.')\n\n# --secondary-private-ip-address-count\nSECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS = (\n    '[EC2-VPC] The number of secondary IP addresses to assign to '\n    'the network interface or instance.')\n\n# --associate-public-ip-address\nASSOCIATE_PUBLIC_IP_ADDRESS_DOCS = (\n    '[EC2-VPC] If specified a public IP address will be assigned '\n    'to the new instance in a VPC.')\n\ndef _add_params(argument_table, operation, **kwargs):\n    arg = SecondaryPrivateIpAddressesArgument(\n        name='secondary-private-ip-addresses',\n        help_text=SECONDARY_PRIVATE_IP_ADDRESSES_DOCS)\n    argument_table['secondary-private-ip-addresses'] = arg\n    arg = SecondaryPrivateIpAddressCountArgument(\n        name='secondary-private-ip-address-count',\n        help_text=SECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS)\n    argument_table['secondary-private-ip-address-count'] = arg\n    arg = AssociatePublicIpAddressArgument(\n        name='associate-public-ip-address',\n        help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS,\n        action='store_true', group_name='associate_public_ip')\n    argument_table['associate-public-ip-address'] = arg\n    arg = NoAssociatePublicIpAddressArgument(\n        name='no-associate-public-ip-address',\n        help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS,\n        action='store_false', group_name='associate_public_ip')\n    argument_table['no-associate-public-ip-address'] = arg\n\n\ndef _check_args(parsed_args, **kwargs):\n    # This function checks the parsed args.  If the user specified\n    # the --network-interfaces option with any of the scalar options we\n    # raise an error.\n    arg_dict = vars(parsed_args)\n    if arg_dict['network_interfaces']:\n        for key in ('secondary_private_ip_addresses',\n                    'secondary_private_ip_address_count',\n                    'associate_public_ip_address'):\n            if arg_dict[key]:\n                msg = ('Mixing the --network-interfaces option '\n                       'with the simple, scalar options is '\n                       'not supported.')\n                raise ValueError(msg)\n\n\ndef _fix_args(operation, endpoint, params, **kwargs):\n    # The RunInstances request provides some parameters\n    # such as --subnet-id and --security-group-id that can be specified\n    # as separate options only if the request DOES NOT include a\n    # NetworkInterfaces structure.  In those cases, the values for\n    # these parameters must be specified inside the NetworkInterfaces\n    # structure.  This function checks for those parameters\n    # and fixes them if necessary.\n    # NOTE: If the user is a default VPC customer, RunInstances\n    # allows them to specify the security group by name or by id.\n    # However, in this scenario we can only support id because\n    # we can't place a group name in the NetworkInterfaces structure.\n    if 'network_interfaces' in params:\n        ni = params['network_interfaces']\n        if 'AssociatePublicIpAddress' in ni[0]:\n            if 'subnet_id' in params:\n                ni[0]['SubnetId'] = params['subnet_id']\n                del params['subnet_id']\n            if 'security_group_ids' in params:\n                ni[0]['Groups'] = params['security_group_ids']\n                del params['security_group_ids']\n\n\nEVENTS = [\n    ('building-argument-table.ec2.run-instances', _add_params),\n    ('operation-args-parsed.ec2.run-instances', _check_args),\n    ('before-parameter-build.ec2.RunInstances', _fix_args),\n    ]\n\n\ndef register_runinstances(event_handler):\n    # Register all of the events for customizing BundleInstance\n    for event, handler in EVENTS:\n        event_handler.register(event, handler)\n\n\ndef _build_network_interfaces(params, key, value):\n    # Build up the NetworkInterfaces data structure\n    if 'network_interfaces' not in params:\n        params['network_interfaces'] = [{'DeviceIndex': 0}]\n\n    if key == 'PrivateIpAddresses':\n        if 'PrivateIpAddresses' not in params['network_interfaces'][0]:\n            params['network_interfaces'][0]['PrivateIpAddresses'] = value\n    else:\n        params['network_interfaces'][0][key] = value\n\n\nclass SecondaryPrivateIpAddressesArgument(CustomArgument):\n\n    def add_to_parser(self, parser, cli_name=None):\n        parser.add_argument(self.cli_name, dest=self.py_name,\n                            default=self._default, nargs='*')\n\n    def add_to_params(self, parameters, value):\n        if value:\n            value = [{'PrivateIpAddress': v, 'Primary': False} for\n                     v in value]\n            _build_network_interfaces(parameters,\n                                      'PrivateIpAddresses',\n                                      value)\n\n\nclass SecondaryPrivateIpAddressCountArgument(CustomArgument):\n\n    def add_to_parser(self, parser, cli_name=None):\n        parser.add_argument(self.cli_name, dest=self.py_name,\n                            default=self._default, type=int)\n\n    def add_to_params(self, parameters, value):\n        if value:\n            _build_network_interfaces(parameters,\n                                      'SecondaryPrivateIpAddressCount',\n                                      value)\n\n\nclass AssociatePublicIpAddressArgument(CustomArgument):\n\n    def add_to_params(self, parameters, value):\n        if value is True:\n            _build_network_interfaces(parameters,\n                                      'AssociatePublicIpAddress',\n                                      value)\n\n\nclass NoAssociatePublicIpAddressArgument(CustomArgument):\n\n    def add_to_params(self, parameters, value):\n        if value is False:\n            _build_network_interfaces(parameters,\n                                      'AssociatePublicIpAddress',\n                                      value)\n", "path": "awscli/customizations/ec2runinstances.py"}], "after_files": [{"content": "# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n#     http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n\"\"\"\nThis customization adds two new parameters to the ``ec2 run-instance``\ncommand.  The first, ``--secondary-private-ip-addresses`` allows a list\nof IP addresses within the specified subnet to be associated with the\nnew instance.  The second, ``--secondary-ip-address-count`` allows you\nto specify how many additional IP addresses you want but the actual\naddress will be assigned for you.\n\nThis functionality (and much more) is also available using the\n``--network-interfaces`` complex argument.  This just makes two of\nthe most commonly used features available more easily.\n\"\"\"\nfrom awscli.arguments import CustomArgument\n\n# --secondary-private-ip-address\nSECONDARY_PRIVATE_IP_ADDRESSES_DOCS = (\n    '[EC2-VPC] A secondary private IP address for the network interface '\n    'or instance. You can specify this multiple times to assign multiple '\n    'secondary IP addresses.  If you want additional private IP addresses '\n    'but do not need a specific address, use the '\n    '--secondary-private-ip-address-count option.')\n\n# --secondary-private-ip-address-count\nSECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS = (\n    '[EC2-VPC] The number of secondary IP addresses to assign to '\n    'the network interface or instance.')\n\n# --associate-public-ip-address\nASSOCIATE_PUBLIC_IP_ADDRESS_DOCS = (\n    '[EC2-VPC] If specified a public IP address will be assigned '\n    'to the new instance in a VPC.')\n\ndef _add_params(argument_table, operation, **kwargs):\n    arg = SecondaryPrivateIpAddressesArgument(\n        name='secondary-private-ip-addresses',\n        help_text=SECONDARY_PRIVATE_IP_ADDRESSES_DOCS)\n    argument_table['secondary-private-ip-addresses'] = arg\n    arg = SecondaryPrivateIpAddressCountArgument(\n        name='secondary-private-ip-address-count',\n        help_text=SECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS)\n    argument_table['secondary-private-ip-address-count'] = arg\n    arg = AssociatePublicIpAddressArgument(\n        name='associate-public-ip-address',\n        help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS,\n        action='store_true', group_name='associate_public_ip')\n    argument_table['associate-public-ip-address'] = arg\n    arg = NoAssociatePublicIpAddressArgument(\n        name='no-associate-public-ip-address',\n        help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS,\n        action='store_false', group_name='associate_public_ip')\n    argument_table['no-associate-public-ip-address'] = arg\n\n\ndef _check_args(parsed_args, **kwargs):\n    # This function checks the parsed args.  If the user specified\n    # the --network-interfaces option with any of the scalar options we\n    # raise an error.\n    arg_dict = vars(parsed_args)\n    if arg_dict['network_interfaces']:\n        for key in ('secondary_private_ip_addresses',\n                    'secondary_private_ip_address_count',\n                    'associate_public_ip_address'):\n            if arg_dict[key]:\n                msg = ('Mixing the --network-interfaces option '\n                       'with the simple, scalar options is '\n                       'not supported.')\n                raise ValueError(msg)\n\n\ndef _fix_args(operation, endpoint, params, **kwargs):\n    # The RunInstances request provides some parameters\n    # such as --subnet-id and --security-group-id that can be specified\n    # as separate options only if the request DOES NOT include a\n    # NetworkInterfaces structure.  In those cases, the values for\n    # these parameters must be specified inside the NetworkInterfaces\n    # structure.  This function checks for those parameters\n    # and fixes them if necessary.\n    # NOTE: If the user is a default VPC customer, RunInstances\n    # allows them to specify the security group by name or by id.\n    # However, in this scenario we can only support id because\n    # we can't place a group name in the NetworkInterfaces structure.\n    if 'network_interfaces' in params:\n        ni = params['network_interfaces']\n        if 'AssociatePublicIpAddress' in ni[0]:\n            if 'subnet_id' in params:\n                ni[0]['SubnetId'] = params['subnet_id']\n                del params['subnet_id']\n            if 'security_group_ids' in params:\n                ni[0]['Groups'] = params['security_group_ids']\n                del params['security_group_ids']\n            if 'private_ip_address' in params:\n                ip_addr = {'PrivateIpAddress': params['private_ip_address'],\n                           'Primary': True}\n                ni[0]['PrivateIpAddresses'] = [ip_addr]\n                del params['private_ip_address']\n\n\nEVENTS = [\n    ('building-argument-table.ec2.run-instances', _add_params),\n    ('operation-args-parsed.ec2.run-instances', _check_args),\n    ('before-parameter-build.ec2.RunInstances', _fix_args),\n    ]\n\n\ndef register_runinstances(event_handler):\n    # Register all of the events for customizing BundleInstance\n    for event, handler in EVENTS:\n        event_handler.register(event, handler)\n\n\ndef _build_network_interfaces(params, key, value):\n    # Build up the NetworkInterfaces data structure\n    if 'network_interfaces' not in params:\n        params['network_interfaces'] = [{'DeviceIndex': 0}]\n\n    if key == 'PrivateIpAddresses':\n        if 'PrivateIpAddresses' not in params['network_interfaces'][0]:\n            params['network_interfaces'][0]['PrivateIpAddresses'] = value\n    else:\n        params['network_interfaces'][0][key] = value\n\n\nclass SecondaryPrivateIpAddressesArgument(CustomArgument):\n\n    def add_to_parser(self, parser, cli_name=None):\n        parser.add_argument(self.cli_name, dest=self.py_name,\n                            default=self._default, nargs='*')\n\n    def add_to_params(self, parameters, value):\n        if value:\n            value = [{'PrivateIpAddress': v, 'Primary': False} for\n                     v in value]\n            _build_network_interfaces(parameters,\n                                      'PrivateIpAddresses',\n                                      value)\n\n\nclass SecondaryPrivateIpAddressCountArgument(CustomArgument):\n\n    def add_to_parser(self, parser, cli_name=None):\n        parser.add_argument(self.cli_name, dest=self.py_name,\n                            default=self._default, type=int)\n\n    def add_to_params(self, parameters, value):\n        if value:\n            _build_network_interfaces(parameters,\n                                      'SecondaryPrivateIpAddressCount',\n                                      value)\n\n\nclass AssociatePublicIpAddressArgument(CustomArgument):\n\n    def add_to_params(self, parameters, value):\n        if value is True:\n            _build_network_interfaces(parameters,\n                                      'AssociatePublicIpAddress',\n                                      value)\n\n\nclass NoAssociatePublicIpAddressArgument(CustomArgument):\n\n    def add_to_params(self, parameters, value):\n        if value is False:\n            _build_network_interfaces(parameters,\n                                      'AssociatePublicIpAddress',\n                                      value)\n", "path": "awscli/customizations/ec2runinstances.py"}]}