release_address
¶
release_address(
*,
config_overrides: Optional[EC2ClientConfig] = None,
allocation_id: Optional[AllocationId] = None,
public_ip: Optional[String] = None,
network_border_group: Optional[String] = None,
dry_run: Optional[Boolean] = None,
) -> None
Releases the specified Elastic IP address.
[Default VPC] Releasing an Elastic IP address automatically disassociates it from any instance that it's associated with. Alternatively, you can disassociate an Elastic IP address without releasing it.
[Nondefault VPC] You must disassociate the Elastic IP address before you can release it. Otherwise, Amazon EC2 returns an error (InvalidIPAddress.InUse).
After releasing an Elastic IP address, it is released to the IP address pool. Be sure to update your DNS records and any servers or devices that communicate with the address. If you attempt to release an Elastic IP address that you already released, you'll get an AuthFailure error if the address is already allocated to another Amazon Web Services account.
After you release an Elastic IP address, you might be able to recover it. For more information, see Release an Elastic IP address.
Parameters:
-
allocation_id(Optional[AllocationId], default:None) –The allocation ID. This parameter is required.
-
public_ip(Optional[String], default:None) –Deprecated.
-
network_border_group(Optional[String], default:None) –The set of Availability Zones, Local Zones, or Wavelength Zones from which Amazon Web Services advertises IP addresses.
If you provide an incorrect network border group, you receive an
InvalidAddress.NotFounderror. -
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 release an Elastic IP address This example releases the specified Elastic IP address.
Source code in docs_src/capo_ec2/_services/ec2.py
56667 56668 56669 56670 56671 56672 56673 56674 56675 56676 56677 56678 56679 56680 56681 56682 56683 56684 56685 56686 56687 56688 56689 56690 56691 56692 56693 56694 56695 56696 56697 56698 56699 56700 56701 56702 56703 56704 56705 56706 56707 56708 56709 56710 56711 56712 56713 56714 56715 56716 56717 56718 56719 56720 56721 56722 56723 56724 56725 | |