Skip to content

modify_vpn_connection_options async

modify_vpn_connection_options(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    vpn_connection_id: Optional[VpnConnectionId] = None,
    local_ipv4_network_cidr: Optional[String] = None,
    remote_ipv4_network_cidr: Optional[String] = None,
    local_ipv6_network_cidr: Optional[String] = None,
    remote_ipv6_network_cidr: Optional[String] = None,
    tunnel_bandwidth: Optional[VpnTunnelBandwidth] = None,
    dry_run: Optional[Boolean] = None,
) -> ModifyVpnConnectionOptionsResult

Modifies the connection options for your Site-to-Site VPN connection.

When you modify the VPN connection options, the VPN endpoint IP addresses on the Amazon Web Services side do not change, and the tunnel options do not change. Your VPN connection will be temporarily unavailable for a brief period while the VPN connection is updated.

Parameters:

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

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

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

    The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection.

    Default: 0.0.0.0/0

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

    The IPv4 CIDR on the Amazon Web Services side of the VPN connection.

    Default: 0.0.0.0/0

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

    The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection.

    Default: ::/0

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

    The IPv6 CIDR on the Amazon Web Services side of the VPN connection.

    Default: ::/0

  • tunnel_bandwidth (Optional[VpnTunnelBandwidth], default: None ) –

    The desired bandwidth specification for the VPN connection. standard supports up to 1.25 Gbps per tunnel, while large supports up to 5 Gbps per tunnel. Large bandwidth is only available for VPN connections attached to a transit gateway or to Cloud WAN. The default value is standard.

  • 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 modify_vpn_connection_options(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    vpn_connection_id: Optional[
        "capo_ec2.types.vpn_connection_id.VpnConnectionId"
    ] = None,
    local_ipv4_network_cidr: Optional["capo_ec2.types.string.String"] = None,
    remote_ipv4_network_cidr: Optional["capo_ec2.types.string.String"] = None,
    local_ipv6_network_cidr: Optional["capo_ec2.types.string.String"] = None,
    remote_ipv6_network_cidr: Optional["capo_ec2.types.string.String"] = None,
    tunnel_bandwidth: Optional[
        "capo_ec2.types.vpn_tunnel_bandwidth.VpnTunnelBandwidth"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_vpn_connection_options_result.ModifyVpnConnectionOptionsResult":
    """<p>Modifies the connection options for your Site-to-Site VPN connection.</p> <p>When you modify the VPN connection options, the VPN endpoint IP addresses on the Amazon Web Services side do not change, and the tunnel options do not change. Your VPN connection will be temporarily unavailable for a brief period while the VPN connection is updated.</p>

    Args:
        vpn_connection_id: <p>The ID of the Site-to-Site VPN connection. </p>
        local_ipv4_network_cidr: <p>The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection.</p> <p>Default: <code>0.0.0.0/0</code> </p>
        remote_ipv4_network_cidr: <p>The IPv4 CIDR on the Amazon Web Services side of the VPN connection.</p> <p>Default: <code>0.0.0.0/0</code> </p>
        local_ipv6_network_cidr: <p>The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection.</p> <p>Default: <code>::/0</code> </p>
        remote_ipv6_network_cidr: <p>The IPv6 CIDR on the Amazon Web Services side of the VPN connection.</p> <p>Default: <code>::/0</code> </p>
        tunnel_bandwidth: <p>The desired bandwidth specification for the VPN connection. <code>standard</code> supports up to 1.25 Gbps per tunnel, while <code>large</code> supports up to 5 Gbps per tunnel. Large bandwidth is only available for VPN connections attached to a transit gateway or to Cloud WAN. The default value is <code>standard</code>.</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.modify_vpn_connection_options_request.ModifyVpnConnectionOptionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_vpn_connection_options_result.ModifyVpnConnectionOptionsResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_vpn_connection_options

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

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

        return capo_ec2.types.modify_vpn_connection_options_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ModifyVpnConnectionOptions", redact_output=_redact_output
        ),
    )
    input_: capo_ec2.types.modify_vpn_connection_options_request.ModifyVpnConnectionOptionsRequest = {}
    if vpn_connection_id is not None:
        input_["vpn_connection_id"] = vpn_connection_id
    if local_ipv4_network_cidr is not None:
        input_["local_ipv4_network_cidr"] = local_ipv4_network_cidr
    if remote_ipv4_network_cidr is not None:
        input_["remote_ipv4_network_cidr"] = remote_ipv4_network_cidr
    if local_ipv6_network_cidr is not None:
        input_["local_ipv6_network_cidr"] = local_ipv6_network_cidr
    if remote_ipv6_network_cidr is not None:
        input_["remote_ipv6_network_cidr"] = remote_ipv6_network_cidr
    if tunnel_bandwidth is not None:
        input_["tunnel_bandwidth"] = tunnel_bandwidth
    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