disassociate_address
¶
disassociate_address(
*,
config_overrides: Optional[EC2ClientConfig] = None,
association_id: Optional[ElasticIpAssociationId] = None,
public_ip: Optional[EipAllocationPublicIp] = None,
dry_run: Optional[Boolean] = None,
) -> None
Disassociates an Elastic IP address from the instance or network interface it's associated with.
This is an idempotent operation. If you perform the operation more than once, Amazon EC2 doesn't return an error.
An address cannot be disassociated if the all of the following conditions are met:
-
Network interface has a
publicDualStackDnsNamepublicDnsName -
Public IPv4 address is the primary public IPv4 address
-
Network interface only has one remaining public IPv4 address
Parameters:
-
association_id(Optional[ElasticIpAssociationId], default:None) –The association ID. This parameter is required.
-
public_ip(Optional[EipAllocationPublicIp], default:None) –Deprecated.
-
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.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To disassociate an Elastic IP address This example disassociates an Elastic IP address from an instance.
Source code in docs_src/capo_ec2/_services/ec2.py
39709 39710 39711 39712 39713 39714 39715 39716 39717 39718 39719 39720 39721 39722 39723 39724 39725 39726 39727 39728 39729 39730 39731 39732 39733 39734 39735 39736 39737 39738 39739 39740 39741 39742 39743 39744 39745 39746 39747 39748 39749 39750 39751 39752 39753 39754 39755 39756 39757 39758 39759 39760 39761 39762 39763 39764 39765 39766 39767 | |