disassociate_nat_gateway_address
¶
disassociate_nat_gateway_address(
*,
config_overrides: Optional[EC2ClientConfig] = None,
nat_gateway_id: Optional[NatGatewayId] = None,
association_ids: Optional[EipAssociationIdList] = None,
max_drain_duration_seconds: Optional[DrainSeconds] = None,
dry_run: Optional[Boolean] = None,
) -> DisassociateNatGatewayAddressResult
Disassociates secondary Elastic IP addresses (EIPs) from a public NAT gateway. You cannot disassociate your primary EIP. For more information, see Edit secondary IP address associations in the Amazon VPC User Guide.
While disassociating is in progress, you cannot associate/disassociate additional EIPs while the connections are being drained. You are, however, allowed to delete the NAT gateway.
An EIP is released only at the end of MaxDrainDurationSeconds. It stays associated and supports the existing connections but does not support any new connections (new connections are distributed across the remaining associated EIPs). As the existing connections drain out, the EIPs (and the corresponding private IP addresses mapped to them) are released.
Parameters:
-
nat_gateway_id(Optional[NatGatewayId], default:None) –The ID of the NAT gateway.
-
association_ids(Optional[EipAssociationIdList], default:None) –The association IDs of EIPs that have been associated with the NAT gateway.
-
max_drain_duration_seconds(Optional[DrainSeconds], default:None) –The maximum amount of time to wait (in seconds) before forcibly releasing the IP addresses if connections are still in progress. Default value is 350 seconds.
-
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.
Source code in docs_src/capo_ec2/_services/ec2.py
40217 40218 40219 40220 40221 40222 40223 40224 40225 40226 40227 40228 40229 40230 40231 40232 40233 40234 40235 40236 40237 40238 40239 40240 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 | |