detach_network_interface
async
¶
detach_network_interface(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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/async_ec2.py
38847 38848 38849 38850 38851 38852 38853 38854 38855 38856 38857 38858 38859 38860 38861 38862 38863 38864 38865 38866 38867 38868 38869 38870 38871 38872 38873 38874 38875 38876 38877 38878 38879 38880 38881 38882 38883 38884 38885 38886 38887 38888 38889 38890 38891 38892 38893 38894 38895 38896 38897 38898 38899 38900 38901 38902 38903 38904 | |