Skip to content

modify_vpn_tunnel_options async

modify_vpn_tunnel_options(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    vpn_connection_id: Optional[VpnConnectionId] = None,
    vpn_tunnel_outside_ip_address: Optional[String] = None,
    tunnel_options: Optional[ModifyVpnTunnelOptionsSpecification] = None,
    dry_run: Optional[Boolean] = None,
    skip_tunnel_replacement: Optional[Boolean] = None,
    pre_shared_key_storage: Optional[String] = None,
) -> ModifyVpnTunnelOptionsResult

Modifies the options for a VPN tunnel in an Amazon Web Services Site-to-Site VPN connection. You can modify multiple options for a tunnel in a single request, but you can only modify one tunnel at a time. For more information, see Site-to-Site VPN tunnel options for your Site-to-Site VPN connection in the Amazon Web Services Site-to-Site VPN User Guide.

Parameters:

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

    The ID of the Amazon Web Services Site-to-Site VPN connection.

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

    The external IP address of the VPN tunnel.

  • tunnel_options (Optional[ModifyVpnTunnelOptionsSpecification], default: None ) –

    The tunnel options to modify.

  • 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.

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

    Choose whether or not to trigger immediate tunnel replacement. This is only applicable when turning on or off EnableTunnelLifecycleControl.

    Valid values: True | False

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

    Specifies the storage mode for the pre-shared key (PSK). Valid values are Standard (stored in Site-to-Site VPN service) or SecretsManager (stored in Amazon Web Services Secrets Manager).

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_vpn_tunnel_options(
    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,
    tunnel_options: Optional[
        "capo_ec2.types.modify_vpn_tunnel_options_specification.ModifyVpnTunnelOptionsSpecification"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    skip_tunnel_replacement: Optional["capo_ec2.types.boolean.Boolean"] = None,
    pre_shared_key_storage: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.modify_vpn_tunnel_options_result.ModifyVpnTunnelOptionsResult":
    """<p>Modifies the options for a VPN tunnel in an Amazon Web Services Site-to-Site VPN connection. You can modify multiple options for a tunnel in a single request, but you can only modify one tunnel at a time. For more information, see <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/VPNTunnels.html">Site-to-Site VPN tunnel options for your Site-to-Site VPN connection</a> in the <i>Amazon Web Services Site-to-Site VPN User Guide</i>.</p>

    Args:
        vpn_connection_id: <p>The ID of the Amazon Web Services Site-to-Site VPN connection.</p>
        vpn_tunnel_outside_ip_address: <p>The external IP address of the VPN tunnel.</p>
        tunnel_options: <p>The tunnel options to modify.</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>
        skip_tunnel_replacement: <p>Choose whether or not to trigger immediate tunnel replacement. This is only applicable when turning on or off <code>EnableTunnelLifecycleControl</code>.</p> <p>Valid values: <code>True</code> | <code>False</code> </p>
        pre_shared_key_storage: <p>Specifies the storage mode for the pre-shared key (PSK). Valid values are <code>Standard</code> (stored in Site-to-Site VPN service) or <code>SecretsManager</code> (stored in Amazon Web Services Secrets Manager).</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.modify_vpn_tunnel_options_request.ModifyVpnTunnelOptionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_vpn_tunnel_options_result.ModifyVpnTunnelOptionsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_vpn_tunnel_options

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

    def _redact_input(
        input_: "capo_ec2.types.modify_vpn_tunnel_options_request.ModifyVpnTunnelOptionsRequest",
    ) -> dict[str, Any]:
        import capo_ec2.types.modify_vpn_tunnel_options_request

        return capo_ec2.types.modify_vpn_tunnel_options_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_ec2.types.modify_vpn_tunnel_options_result.ModifyVpnTunnelOptionsResult",
    ) -> dict[str, Any]:
        import capo_ec2.types.modify_vpn_tunnel_options_result

        return capo_ec2.types.modify_vpn_tunnel_options_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ModifyVpnTunnelOptions",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_ec2.types.modify_vpn_tunnel_options_request.ModifyVpnTunnelOptionsRequest = {}
    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 tunnel_options is not None:
        input_["tunnel_options"] = tunnel_options
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if skip_tunnel_replacement is not None:
        input_["skip_tunnel_replacement"] = skip_tunnel_replacement
    if pre_shared_key_storage is not None:
        input_["pre_shared_key_storage"] = pre_shared_key_storage

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