Skip to content

authorize_client_vpn_ingress async

authorize_client_vpn_ingress(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    client_vpn_endpoint_id: Optional[ClientVpnEndpointId] = None,
    target_network_cidr: Optional[String] = None,
    access_group_id: Optional[String] = None,
    authorize_all_groups: Optional[Boolean] = None,
    description: Optional[String] = None,
    client_token: Optional[String] = None,
    dry_run: Optional[Boolean] = None,
) -> AuthorizeClientVpnIngressResult

Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization rules act as firewall rules that grant access to networks. You must configure ingress authorization rules to enable clients to access resources in Amazon Web Services or on-premises networks.

Parameters:

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

    The ID of the Client VPN endpoint.

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

    The IPv4 address range, in CIDR notation, of the network for which access is being authorized.

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

    The ID of the group to grant access to, for example, the Active Directory group or identity provider (IdP) group. Required if AuthorizeAllGroups is false or not specified.

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

    Indicates whether to grant access to all clients. Specify true to grant all clients who successfully establish a VPN connection access to the network. Must be set to true if AccessGroupId is not specified.

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

    A brief description of the authorization rule.

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

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

  • 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 authorize_client_vpn_ingress(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    client_vpn_endpoint_id: Optional[
        "capo_ec2.types.client_vpn_endpoint_id.ClientVpnEndpointId"
    ] = None,
    target_network_cidr: Optional["capo_ec2.types.string.String"] = None,
    access_group_id: Optional["capo_ec2.types.string.String"] = None,
    authorize_all_groups: Optional["capo_ec2.types.boolean.Boolean"] = None,
    description: Optional["capo_ec2.types.string.String"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.authorize_client_vpn_ingress_result.AuthorizeClientVpnIngressResult":
    """<p>Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization rules act as firewall rules that grant access to networks. You must configure ingress authorization rules to enable clients to access resources in Amazon Web Services or on-premises networks.</p>

    Args:
        client_vpn_endpoint_id: <p>The ID of the Client VPN endpoint.</p>
        target_network_cidr: <p>The IPv4 address range, in CIDR notation, of the network for which access is being authorized.</p>
        access_group_id: <p>The ID of the group to grant access to, for example, the Active Directory group or identity provider (IdP) group. Required if <code>AuthorizeAllGroups</code> is <code>false</code> or not specified.</p>
        authorize_all_groups: <p>Indicates whether to grant access to all clients. Specify <code>true</code> to grant all clients who successfully establish a VPN connection access to the network. Must be set to <code>true</code> if <code>AccessGroupId</code> is not specified.</p>
        description: <p>A brief description of the authorization rule.</p>
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</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.authorize_client_vpn_ingress_request.AuthorizeClientVpnIngressRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.authorize_client_vpn_ingress_result.AuthorizeClientVpnIngressResult"
    ]:
        import capo_ec2._operations.amazon_ec2.authorize_client_vpn_ingress

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AuthorizeClientVpnIngress")
    )
    input_: capo_ec2.types.authorize_client_vpn_ingress_request.AuthorizeClientVpnIngressRequest = {}
    if client_vpn_endpoint_id is not None:
        input_["client_vpn_endpoint_id"] = client_vpn_endpoint_id
    if target_network_cidr is not None:
        input_["target_network_cidr"] = target_network_cidr
    if access_group_id is not None:
        input_["access_group_id"] = access_group_id
    if authorize_all_groups is not None:
        input_["authorize_all_groups"] = authorize_all_groups
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    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