attach_network_interface
¶
attach_network_interface(
*,
config_overrides: Optional[EC2ClientConfig] = None,
network_card_index: Optional[Integer] = None,
ena_srd_specification: Optional[EnaSrdSpecification] = None,
ena_queue_count: Optional[Integer] = None,
dry_run: Optional[Boolean] = None,
network_interface_id: Optional[NetworkInterfaceId] = None,
instance_id: Optional[InstanceId] = None,
device_index: Optional[Integer] = None,
) -> AttachNetworkInterfaceResult
Attaches a network interface to an instance.
Parameters:
-
network_card_index(Optional[Integer], default:None) –The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.
-
ena_srd_specification(Optional[EnaSrdSpecification], default:None) –Configures ENA Express for the network interface that this action attaches to the instance.
-
ena_queue_count(Optional[Integer], default:None) –The number of ENA queues to be created with the instance.
-
dry_run(Optional[Boolean], default:None) –Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation. -
network_interface_id(Optional[NetworkInterfaceId], default:None) –The ID of the network interface.
-
instance_id(Optional[InstanceId], default:None) –The ID of the instance.
-
device_index(Optional[Integer], default:None) –The index of the device for the network interface attachment.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To attach a network interface to an instance This example attaches the specified network interface to the specified instance.
>>> client.attach_network_interface(network_interface_id='eni-e5aa89a3', instance_id='i-1234567890abcdef0', device_index=1)
Source code in docs_src/capo_ec2/_services/ec2.py
5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 | |