attach_network_interface
async
¶
attach_network_interface(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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.
>>> await client.attach_network_interface(network_interface_id='eni-e5aa89a3', instance_id='i-1234567890abcdef0', device_index=1)
Source code in docs_src/capo_ec2/_services/async_ec2.py
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 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 | |