Deletes the specified VPN connection.
If you're deleting the VPC and its associated components, we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. If you believe that the tunnel credentials for your VPN connection have been compromised, you can delete the VPN connection and create a new one that has new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN connection, you must reconfigure the customer gateway device using the new configuration information returned with the new VPN connection ID.
For certificate-based authentication, delete all Certificate Manager (ACM) private certificates used for the Amazon Web Services-side tunnel endpoints for the VPN connection before deleting the VPN connection.
Parameters:
-
vpn_connection_id
(Optional[VpnConnectionId], default:
None
)
–
The ID of the VPN connection.
-
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 is UnauthorizedOperation.
Raises:
Source code in docs_src/capo_ec2/_services/ec2.py
| def delete_vpn_connection(
self,
*,
config_overrides: Optional[EC2ClientConfig] = None,
vpn_connection_id: Optional[
"capo_ec2.types.vpn_connection_id.VpnConnectionId"
] = None,
dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> None:
"""<p>Deletes the specified VPN connection.</p> <p>If you're deleting the VPC and its associated components, we recommend that you detach the virtual private gateway from the VPC and delete the VPC before deleting the VPN connection. If you believe that the tunnel credentials for your VPN connection have been compromised, you can delete the VPN connection and create a new one that has new keys, without needing to delete the VPC or virtual private gateway. If you create a new VPN connection, you must reconfigure the customer gateway device using the new configuration information returned with the new VPN connection ID.</p> <p>For certificate-based authentication, delete all Certificate Manager (ACM) private certificates used for the Amazon Web Services-side tunnel endpoints for the VPN connection before deleting the VPN connection.</p>
Args:
vpn_connection_id: <p>The ID of the VPN connection.</p>
dry_run: <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
Raises:
capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ec2.types.delete_vpn_connection_request.DeleteVpnConnectionRequest]",
) -> OperationResponse[None]:
import capo_ec2._operations.amazon_ec2.delete_vpn_connection
output, http_response = (
capo_ec2._operations.amazon_ec2.delete_vpn_connection.delete_vpn_connection(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteVpnConnection")
)
input_: capo_ec2.types.delete_vpn_connection_request.DeleteVpnConnectionRequest = {}
if vpn_connection_id is not None:
input_["vpn_connection_id"] = vpn_connection_id
if dry_run is not None:
input_["dry_run"] = dry_run
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|