Skip to content

create_vpc_endpoint async

create_vpc_endpoint(
    domain_arn: DomainArn,
    vpc_options: VPCOptions,
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateVpcEndpointResponse

Creates an Amazon OpenSearch Service-managed VPC endpoint.

Parameters:

  • domain_arn (DomainArn) –

    The Amazon Resource Name (ARN) of the domain to create the endpoint for.

  • vpc_options (VPCOptions) –

    Options to specify the subnets and security groups for the endpoint.

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

    Unique, case-sensitive identifier to ensure idempotency of the request.

Raises:

  • BaseException –

    An error occurred while processing the request.

  • ConflictException –

    An error occurred because the client attempts to remove a resource that is currently in use.

  • DisabledOperationException –

    An error occured because the client wanted to access an unsupported operation.

  • InternalException –

    Request processing failed because of an unknown error, exception, or internal failure.

  • LimitExceededException –

    An exception for trying to create more than the allowed number of resources or sub-resources.

  • ValidationException –

    An exception for accessing or deleting a resource that doesn't exist.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_opensearch/_services/async_open_search.py
async def create_vpc_endpoint(
    self,
    domain_arn: "capo_opensearch.types.domain_arn.DomainArn",
    vpc_options: "capo_opensearch.types.vpc_options.VPCOptions",
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
    client_token: Optional["capo_opensearch.types.client_token.ClientToken"] = None,
) -> "capo_opensearch.types.create_vpc_endpoint_response.CreateVpcEndpointResponse":
    """<p>Creates an Amazon OpenSearch Service-managed VPC endpoint.</p>

    Args:
        domain_arn: <p>The Amazon Resource Name (ARN) of the domain to create the endpoint for.</p>
        vpc_options: <p>Options to specify the subnets and security groups for the endpoint.</p>
        client_token: <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>

    Raises:
        capo_opensearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_opensearch.errors.conflict_exception.ConflictException: <p>An error occurred because the client attempts to remove a resource that is currently in use.</p>
        capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than the allowed number of resources or sub-resources.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_opensearch.types.create_vpc_endpoint_request.CreateVpcEndpointRequest]",
    ) -> AsyncOperationResponse[
        "capo_opensearch.types.create_vpc_endpoint_response.CreateVpcEndpointResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.create_vpc_endpoint

        (
            output,
            http_response,
        ) = await capo_opensearch._operations.amazon_open_search_service.create_vpc_endpoint.async_create_vpc_endpoint(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateVpcEndpoint")
    )
    input_: capo_opensearch.types.create_vpc_endpoint_request.CreateVpcEndpointRequest = {
        "domain_arn": domain_arn,
        "vpc_options": vpc_options,
    }
    if client_token is not None:
        input_["client_token"] = client_token

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