disassociate_address
async
¶
disassociate_address(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = 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/async_ec2.py
40241 40242 40243 40244 40245 40246 40247 40248 40249 40250 40251 40252 40253 40254 40255 40256 40257 40258 40259 40260 40261 40262 40263 40264 40265 40266 40267 40268 40269 40270 40271 40272 40273 40274 40275 40276 40277 40278 40279 40280 40281 40282 40283 40284 40285 40286 40287 40288 40289 40290 40291 40292 40293 40294 40295 40296 40297 40298 40299 40300 | |