Skip to content

replace_vpn_tunnel async

replace_vpn_tunnel(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    vpn_connection_id: Optional[VpnConnectionId] = None,
    vpn_tunnel_outside_ip_address: Optional[String] = None,
    apply_pending_maintenance: Optional[Boolean] = None,
    dry_run: Optional[Boolean] = None,
) -> ReplaceVpnTunnelResult

Trigger replacement of specified VPN tunnel.

Parameters:

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

    The ID of the Site-to-Site VPN connection.

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

    The external IP address of the VPN tunnel.

  • apply_pending_maintenance (Optional[Boolean], default: None ) –

    Trigger pending tunnel endpoint maintenance.

  • 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/async_ec2.py
async def replace_vpn_tunnel(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    vpn_connection_id: Optional[
        "capo_ec2.types.vpn_connection_id.VpnConnectionId"
    ] = None,
    vpn_tunnel_outside_ip_address: Optional["capo_ec2.types.string.String"] = None,
    apply_pending_maintenance: Optional["capo_ec2.types.boolean.Boolean"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.replace_vpn_tunnel_result.ReplaceVpnTunnelResult":
    """<p>Trigger replacement of specified VPN tunnel.</p>

    Args:
        vpn_connection_id: <p>The ID of the Site-to-Site VPN connection. </p>
        vpn_tunnel_outside_ip_address: <p>The external IP address of the VPN tunnel.</p>
        apply_pending_maintenance: <p>Trigger pending tunnel endpoint maintenance.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.replace_vpn_tunnel_request.ReplaceVpnTunnelRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.replace_vpn_tunnel_result.ReplaceVpnTunnelResult"
    ]:
        import capo_ec2._operations.amazon_ec2.replace_vpn_tunnel

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.replace_vpn_tunnel.async_replace_vpn_tunnel(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ReplaceVpnTunnel")
    )
    input_: capo_ec2.types.replace_vpn_tunnel_request.ReplaceVpnTunnelRequest = {}
    if vpn_connection_id is not None:
        input_["vpn_connection_id"] = vpn_connection_id
    if vpn_tunnel_outside_ip_address is not None:
        input_["vpn_tunnel_outside_ip_address"] = vpn_tunnel_outside_ip_address
    if apply_pending_maintenance is not None:
        input_["apply_pending_maintenance"] = apply_pending_maintenance
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output