detach_network_interface
¶
detach_network_interface(
*,
config_overrides: Optional[EC2ClientConfig] = None,
dry_run: Optional[Boolean] = None,
attachment_id: Optional[NetworkInterfaceAttachmentId] = None,
force: Optional[Boolean] = None,
) -> None
Detaches a network interface from an instance.
Parameters:
-
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. -
attachment_id(Optional[NetworkInterfaceAttachmentId], default:None) –The ID of the attachment.
-
force(Optional[Boolean], default:None) –Specifies whether to force a detachment.
-
Use the
Forceparameter only as a last resort to detach a network interface from a failed instance. -
If you use the
Forceparameter to detach a network interface, you might not be able to attach a different network interface to the same index on the instance without first stopping and starting the instance. -
If you force the detachment of a network interface, the instance metadata might not get updated. This means that the attributes associated with the detached network interface might still be visible. The instance metadata will get updated when you stop and start the instance.
-
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To detach a network interface from an instance This example detaches the specified network interface from its attached instance.
Source code in docs_src/capo_ec2/_services/ec2.py
38343 38344 38345 38346 38347 38348 38349 38350 38351 38352 38353 38354 38355 38356 38357 38358 38359 38360 38361 38362 38363 38364 38365 38366 38367 38368 38369 38370 38371 38372 38373 38374 38375 38376 38377 38378 38379 38380 38381 38382 38383 38384 38385 38386 38387 38388 38389 38390 38391 38392 38393 38394 38395 38396 38397 38398 38399 | |