Skip to content

modify_client_vpn_endpoint async

modify_client_vpn_endpoint(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    client_vpn_endpoint_id: Optional[ClientVpnEndpointId] = None,
    server_certificate_arn: Optional[String] = None,
    connection_log_options: Optional[ConnectionLogOptions] = None,
    dns_servers: Optional[DnsServersOptionsModifyStructure] = None,
    vpn_port: Optional[Integer] = None,
    description: Optional[String] = None,
    split_tunnel: Optional[Boolean] = None,
    dry_run: Optional[Boolean] = None,
    security_group_ids: Optional[ClientVpnSecurityGroupIdSet] = None,
    vpc_id: Optional[VpcId] = None,
    self_service_portal: Optional[SelfServicePortal] = None,
    client_connect_options: Optional[ClientConnectOptions] = None,
    session_timeout_hours: Optional[Integer] = None,
    client_login_banner_options: Optional[ClientLoginBannerOptions] = None,
    client_route_enforcement_options: Optional[ClientRouteEnforcementOptions] = None,
    disconnect_on_session_timeout: Optional[Boolean] = None,
    transit_gateway_configuration: Optional[
        TransitGatewayConfigurationInputStructure
    ] = None,
    device_posture_options: Optional[DevicePostureOptions] = None,
) -> ModifyClientVpnEndpointResult

Modifies the specified Client VPN endpoint. Modifying the DNS server resets existing client connections.

Parameters:

  • client_vpn_endpoint_id (Optional[ClientVpnEndpointId], default: None ) –

    The ID of the Client VPN endpoint to modify.

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

    The ARN of the server certificate to be used. The server certificate must be provisioned in Certificate Manager (ACM).

  • connection_log_options (Optional[ConnectionLogOptions], default: None ) –

    Information about the client connection logging options.

    If you enable client connection logging, data about client connections is sent to a Cloudwatch Logs log stream. The following information is logged:

    • Client connection requests

    • Client connection results (successful and unsuccessful)

    • Reasons for unsuccessful client connection requests

    • Client connection termination time

  • dns_servers (Optional[DnsServersOptionsModifyStructure], default: None ) –

    Information about the DNS servers to be used by Client VPN connections. A Client VPN endpoint can have up to two DNS servers.

  • vpn_port (Optional[Integer], default: None ) –

    The port number to assign to the Client VPN endpoint for TCP and UDP traffic.

    Valid Values: 443 | 1194

    Default Value: 443

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

    A brief description of the Client VPN endpoint.

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

    Indicates whether the VPN is split-tunnel.

    For information about split-tunnel VPN endpoints, see Split-tunnel Client VPN endpoint in the Client VPN Administrator Guide.

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

  • security_group_ids (Optional[ClientVpnSecurityGroupIdSet], default: None ) –

    The IDs of one or more security groups to apply to the target network.

  • vpc_id (Optional[VpcId], default: None ) –

    The ID of the VPC to associate with the Client VPN endpoint.

  • self_service_portal (Optional[SelfServicePortal], default: None ) –

    Specify whether to enable the self-service portal for the Client VPN endpoint.

  • client_connect_options (Optional[ClientConnectOptions], default: None ) –

    The options for managing connection authorization for new client connections.

  • session_timeout_hours (Optional[Integer], default: None ) –

    The maximum VPN session duration time in hours.

    Valid values: 8 | 10 | 12 | 24

    Default value: 24

  • client_login_banner_options (Optional[ClientLoginBannerOptions], default: None ) –

    Options for enabling a customizable text banner that will be displayed on Amazon Web Services provided clients when a VPN session is established.

  • client_route_enforcement_options (Optional[ClientRouteEnforcementOptions], default: None ) –

    Client route enforcement is a feature of the Client VPN service that helps enforce administrator defined routes on devices connected through the VPN. T his feature helps improve your security posture by ensuring that network traffic originating from a connected client is not inadvertently sent outside the VPN tunnel.

    Client route enforcement works by monitoring the route table of a connected device for routing policy changes to the VPN connection. If the feature detects any VPN routing policy modifications, it will automatically force an update to the route table, reverting it back to the expected route configurations.

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

    Indicates whether the client VPN session is disconnected after the maximum timeout specified in sessionTimeoutHours is reached. If true, users are prompted to reconnect client VPN. If false, client VPN attempts to reconnect automatically. The default value is true.

  • transit_gateway_configuration (Optional[TransitGatewayConfigurationInputStructure], default: None ) –

    The Transit Gateway configuration for the Client VPN endpoint. This option is currently not supported.

  • device_posture_options (Optional[DevicePostureOptions], default: None ) –

    The device posture options for the Client VPN endpoint. Specifying this parameter replaces the entire device posture configuration for the endpoint. To remove all device trust providers, specify an empty list.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_client_vpn_endpoint(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    client_vpn_endpoint_id: Optional[
        "capo_ec2.types.client_vpn_endpoint_id.ClientVpnEndpointId"
    ] = None,
    server_certificate_arn: Optional["capo_ec2.types.string.String"] = None,
    connection_log_options: Optional[
        "capo_ec2.types.connection_log_options.ConnectionLogOptions"
    ] = None,
    dns_servers: Optional[
        "capo_ec2.types.dns_servers_options_modify_structure.DnsServersOptionsModifyStructure"
    ] = None,
    vpn_port: Optional["capo_ec2.types.integer.Integer"] = None,
    description: Optional["capo_ec2.types.string.String"] = None,
    split_tunnel: Optional["capo_ec2.types.boolean.Boolean"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    security_group_ids: Optional[
        "capo_ec2.types.client_vpn_security_group_id_set.ClientVpnSecurityGroupIdSet"
    ] = None,
    vpc_id: Optional["capo_ec2.types.vpc_id.VpcId"] = None,
    self_service_portal: Optional[
        "capo_ec2.types.self_service_portal.SelfServicePortal"
    ] = None,
    client_connect_options: Optional[
        "capo_ec2.types.client_connect_options.ClientConnectOptions"
    ] = None,
    session_timeout_hours: Optional["capo_ec2.types.integer.Integer"] = None,
    client_login_banner_options: Optional[
        "capo_ec2.types.client_login_banner_options.ClientLoginBannerOptions"
    ] = None,
    client_route_enforcement_options: Optional[
        "capo_ec2.types.client_route_enforcement_options.ClientRouteEnforcementOptions"
    ] = None,
    disconnect_on_session_timeout: Optional[
        "capo_ec2.types.boolean.Boolean"
    ] = None,
    transit_gateway_configuration: Optional[
        "capo_ec2.types.transit_gateway_configuration_input_structure.TransitGatewayConfigurationInputStructure"
    ] = None,
    device_posture_options: Optional[
        "capo_ec2.types.device_posture_options.DevicePostureOptions"
    ] = None,
) -> (
    "capo_ec2.types.modify_client_vpn_endpoint_result.ModifyClientVpnEndpointResult"
):
    """<p>Modifies the specified Client VPN endpoint. Modifying the DNS server resets existing client connections.</p>

    Args:
        client_vpn_endpoint_id: <p>The ID of the Client VPN endpoint to modify.</p>
        server_certificate_arn: <p>The ARN of the server certificate to be used. The server certificate must be provisioned in Certificate Manager (ACM).</p>
        connection_log_options: <p>Information about the client connection logging options.</p> <p>If you enable client connection logging, data about client connections is sent to a Cloudwatch Logs log stream. The following information is logged:</p> <ul> <li> <p>Client connection requests</p> </li> <li> <p>Client connection results (successful and unsuccessful)</p> </li> <li> <p>Reasons for unsuccessful client connection requests</p> </li> <li> <p>Client connection termination time</p> </li> </ul>
        dns_servers: <p>Information about the DNS servers to be used by Client VPN connections. A Client VPN endpoint can have up to two DNS servers.</p>
        vpn_port: <p>The port number to assign to the Client VPN endpoint for TCP and UDP traffic.</p> <p>Valid Values: <code>443</code> | <code>1194</code> </p> <p>Default Value: <code>443</code> </p>
        description: <p>A brief description of the Client VPN endpoint.</p>
        split_tunnel: <p>Indicates whether the VPN is split-tunnel.</p> <p>For information about split-tunnel VPN endpoints, see <a href="https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html">Split-tunnel Client VPN endpoint</a> in the <i>Client VPN Administrator Guide</i>.</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>
        security_group_ids: <p>The IDs of one or more security groups to apply to the target network.</p>
        vpc_id: <p>The ID of the VPC to associate with the Client VPN endpoint.</p>
        self_service_portal: <p>Specify whether to enable the self-service portal for the Client VPN endpoint.</p>
        client_connect_options: <p>The options for managing connection authorization for new client connections.</p>
        session_timeout_hours: <p>The maximum VPN session duration time in hours.</p> <p>Valid values: <code>8 | 10 | 12 | 24</code> </p> <p>Default value: <code>24</code> </p>
        client_login_banner_options: <p>Options for enabling a customizable text banner that will be displayed on Amazon Web Services provided clients when a VPN session is established.</p>
        client_route_enforcement_options: <p>Client route enforcement is a feature of the Client VPN service that helps enforce administrator defined routes on devices connected through the VPN. T his feature helps improve your security posture by ensuring that network traffic originating from a connected client is not inadvertently sent outside the VPN tunnel.</p> <p>Client route enforcement works by monitoring the route table of a connected device for routing policy changes to the VPN connection. If the feature detects any VPN routing policy modifications, it will automatically force an update to the route table, reverting it back to the expected route configurations.</p>
        disconnect_on_session_timeout: <p>Indicates whether the client VPN session is disconnected after the maximum timeout specified in <code>sessionTimeoutHours</code> is reached. If <code>true</code>, users are prompted to reconnect client VPN. If <code>false</code>, client VPN attempts to reconnect automatically. The default value is <code>true</code>.</p>
        transit_gateway_configuration: <p>The Transit Gateway configuration for the Client VPN endpoint. This option is currently not supported.</p>
        device_posture_options: <p>The device posture options for the Client VPN endpoint. Specifying this parameter replaces the entire device posture configuration for the endpoint. To remove all device trust providers, specify an empty list.</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_client_vpn_endpoint_request.ModifyClientVpnEndpointRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_client_vpn_endpoint_result.ModifyClientVpnEndpointResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_client_vpn_endpoint

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ModifyClientVpnEndpoint")
    )
    input_: capo_ec2.types.modify_client_vpn_endpoint_request.ModifyClientVpnEndpointRequest = {}
    if client_vpn_endpoint_id is not None:
        input_["client_vpn_endpoint_id"] = client_vpn_endpoint_id
    if server_certificate_arn is not None:
        input_["server_certificate_arn"] = server_certificate_arn
    if connection_log_options is not None:
        input_["connection_log_options"] = connection_log_options
    if dns_servers is not None:
        input_["dns_servers"] = dns_servers
    if vpn_port is not None:
        input_["vpn_port"] = vpn_port
    if description is not None:
        input_["description"] = description
    if split_tunnel is not None:
        input_["split_tunnel"] = split_tunnel
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if vpc_id is not None:
        input_["vpc_id"] = vpc_id
    if self_service_portal is not None:
        input_["self_service_portal"] = self_service_portal
    if client_connect_options is not None:
        input_["client_connect_options"] = client_connect_options
    if session_timeout_hours is not None:
        input_["session_timeout_hours"] = session_timeout_hours
    if client_login_banner_options is not None:
        input_["client_login_banner_options"] = client_login_banner_options
    if client_route_enforcement_options is not None:
        input_["client_route_enforcement_options"] = (
            client_route_enforcement_options
        )
    if disconnect_on_session_timeout is not None:
        input_["disconnect_on_session_timeout"] = disconnect_on_session_timeout
    if transit_gateway_configuration is not None:
        input_["transit_gateway_configuration"] = transit_gateway_configuration
    if device_posture_options is not None:
        input_["device_posture_options"] = device_posture_options

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