Skip to content

update_vpc_endpoint

update_vpc_endpoint(
    id: VpcEndpointId,
    *,
    config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
    add_subnet_ids: Optional[SubnetIds] = None,
    remove_subnet_ids: Optional[SubnetIds] = None,
    add_security_group_ids: Optional[SecurityGroupIds] = None,
    remove_security_group_ids: Optional[SecurityGroupIds] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateVpcEndpointResponse

Updates an OpenSearch Serverless-managed interface endpoint. For more information, see Access Amazon OpenSearch Serverless using an interface endpoint.

Parameters:

  • id (VpcEndpointId) –

    The unique identifier of the interface endpoint to update.

  • add_subnet_ids (Optional[SubnetIds], default: None ) –

    The ID of one or more subnets to add to the endpoint.

  • remove_subnet_ids (Optional[SubnetIds], default: None ) –

    The unique identifiers of the subnets to remove from the endpoint.

  • add_security_group_ids (Optional[SecurityGroupIds], default: None ) –

    The unique identifiers of the security groups to add to the endpoint. Security groups define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.

  • remove_security_group_ids (Optional[SecurityGroupIds], default: None ) –

    The unique identifiers of the security groups to remove from the endpoint.

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

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

Raises:

  • ConflictException –

    When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.

  • InternalServerException –

    Thrown when an error internal to the service occurs while processing a request.

  • ValidationException –

    Thrown when the HTTP request contains invalid input or is missing required input.

  • UnknownServiceError –

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

Source code in docs_src/capo_opensearchserverless/_services/open_search_serverless.py
def update_vpc_endpoint(
    self,
    id: "capo_opensearchserverless.types.vpc_endpoint_id.VpcEndpointId",
    *,
    config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
    add_subnet_ids: Optional[
        "capo_opensearchserverless.types.subnet_ids.SubnetIds"
    ] = None,
    remove_subnet_ids: Optional[
        "capo_opensearchserverless.types.subnet_ids.SubnetIds"
    ] = None,
    add_security_group_ids: Optional[
        "capo_opensearchserverless.types.security_group_ids.SecurityGroupIds"
    ] = None,
    remove_security_group_ids: Optional[
        "capo_opensearchserverless.types.security_group_ids.SecurityGroupIds"
    ] = None,
    client_token: Optional[
        "capo_opensearchserverless.types.client_token.ClientToken"
    ] = None,
) -> "capo_opensearchserverless.types.update_vpc_endpoint_response.UpdateVpcEndpointResponse":
    """<p>Updates an OpenSearch Serverless-managed interface endpoint. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html">Access Amazon OpenSearch Serverless using an interface endpoint</a>.</p>

    Args:
        id: <p>The unique identifier of the interface endpoint to update.</p>
        add_subnet_ids: <p>The ID of one or more subnets to add to the endpoint.</p>
        remove_subnet_ids: <p>The unique identifiers of the subnets to remove from the endpoint.</p>
        add_security_group_ids: <p>The unique identifiers of the security groups to add to the endpoint. Security groups define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.</p>
        remove_security_group_ids: <p>The unique identifiers of the security groups to remove from the endpoint.</p>
        client_token: <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>

    Raises:
        capo_opensearchserverless.errors.conflict_exception.ConflictException: <p>When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.</p>
        capo_opensearchserverless.errors.internal_server_exception.InternalServerException: <p>Thrown when an error internal to the service occurs while processing a request.</p>
        capo_opensearchserverless.errors.validation_exception.ValidationException: <p>Thrown when the HTTP request contains invalid input or is missing required input.</p>
        capo_opensearchserverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_opensearchserverless.types.update_vpc_endpoint_request.UpdateVpcEndpointRequest]",
    ) -> OperationResponse[
        "capo_opensearchserverless.types.update_vpc_endpoint_response.UpdateVpcEndpointResponse"
    ]:
        import capo_opensearchserverless._operations.open_search_serverless.update_vpc_endpoint

        output, http_response = (
            capo_opensearchserverless._operations.open_search_serverless.update_vpc_endpoint.update_vpc_endpoint(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateVpcEndpoint")
    )
    input_: capo_opensearchserverless.types.update_vpc_endpoint_request.UpdateVpcEndpointRequest = {
        "id": id
    }
    if add_subnet_ids is not None:
        input_["add_subnet_ids"] = add_subnet_ids
    if remove_subnet_ids is not None:
        input_["remove_subnet_ids"] = remove_subnet_ids
    if add_security_group_ids is not None:
        input_["add_security_group_ids"] = add_security_group_ids
    if remove_security_group_ids is not None:
        input_["remove_security_group_ids"] = remove_security_group_ids
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output