Skip to content

delete_vpn_connection_route

delete_vpn_connection_route(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    destination_cidr_block: Optional[String] = None,
    vpn_connection_id: Optional[VpnConnectionId] = None,
) -> None

Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.

Parameters:

  • destination_cidr_block (Optional[String], default: None ) –

    The CIDR block associated with the local subnet of the customer network.

  • vpn_connection_id (Optional[VpnConnectionId], default: None ) –

    The ID of the VPN connection.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def delete_vpn_connection_route(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    destination_cidr_block: Optional["capo_ec2.types.string.String"] = None,
    vpn_connection_id: Optional[
        "capo_ec2.types.vpn_connection_id.VpnConnectionId"
    ] = None,
) -> None:
    """<p>Deletes the specified static route associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.</p>

    Args:
        destination_cidr_block: <p>The CIDR block associated with the local subnet of the customer network.</p>
        vpn_connection_id: <p>The ID of the VPN connection.</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_route_request.DeleteVpnConnectionRouteRequest]",
    ) -> OperationResponse[None]:
        import capo_ec2._operations.amazon_ec2.delete_vpn_connection_route

        output, http_response = (
            capo_ec2._operations.amazon_ec2.delete_vpn_connection_route.delete_vpn_connection_route(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteVpnConnectionRoute")
    )
    input_: capo_ec2.types.delete_vpn_connection_route_request.DeleteVpnConnectionRouteRequest = {}
    if destination_cidr_block is not None:
        input_["destination_cidr_block"] = destination_cidr_block
    if vpn_connection_id is not None:
        input_["vpn_connection_id"] = vpn_connection_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output