Updated on 2024-10-26 GMT+08:00

Configuring VPC Endpoint Service for an OpenSearch Cluster

VPC Endpoint Service enables you to access resources across Virtual Private Clouds (VPCs) using a dedicated gateway, without exposing network information of servers. When VPC Endpoint Service is enabled, a VPC endpoint will be created by default. You can select Private Domain Name Creation if necessary. Users will be able to access this cluster across VPCs through node IP addresses or a private domain name.

VPC Endpoint uses a shared load balancer for intranet access. If your workloads require quicker access, you are advised to use a dedicated load balancer to connect to your cluster. For details about its configuration, see Configuring a Dedicated Load Balancer for an Elasticsearch Cluster.

Constraints

  • After VPC Endpoint Service is enabled for a cluster, you will be billed per use for the service. For more information, see Billing Modes.
  • If a shared VPC and a subnet within this shared VPC were selected earlier for the cluster on the Network page, VPC Endpoint Service cannot be enabled for the cluster.
  • VPC endpoint creation requires specific permissions. For details, see VPCEP Permissions.
  • Public network access and the VPC Endpoint service share a load balancer. If you configure a whitelist for public network access, and because this whitelist is deployed to the shared load balancer, it will control not only access from the public network, but also access using private IP addresses through VPCEP. In this case, you need to add IP address 198.19.128.0/17 to the public network access whitelist to allow traffic through VPCEP.
  • After VPCEP is enabled, access to CSS through a VPCEP IP address or private domain name is not controlled by any cluster security group rules. Rather, you need to configure a VPCEP whitelist to implement access control. For details, see Configuring Access Control for a VPC Endpoint.

Enabling the VPC Endpoint Service

  1. Log in to the CSS management console.
  2. Click Create Cluster in the upper right corner.
  3. On the Create Cluster page, set Advanced Settings to Custom. Enable the VPC endpoint service.
    Figure 1 Enabling VPC Endpoint Service
    Table 1 Configuring VPC Endpoint Service

    Parameter

    Description

    Private Domain Name Creation

    If Private Domain Name Creation is selected, the system generates a node IP address and also automatically creates a private domain name, which enables users to access this cluster from within the same VPC. If it is not selected, only a node IP address is generated.

    Create professional endpoints

    Choose whether to create professional endpoints.

    • If unselected, a basic endpoint will be created.
    • If selected, a professional endpoint will be created.
    NOTE:

    If the region where the cluster is located does not support professional endpoints, this option is grayed out. By default, a basic endpoint is created.

    IPv4/IPv6 dual stack network

    Whether to enable IPv4/IPv6 dual-stack networking. This option is available only when IPv6 is enabled for the VPC subnet of the cluster and you have selected Create professional endpoints earlier.

    VPC Endpoint Service Whitelist

    In VPC Endpoint Service Whitelist, you can add accounts that are allowed to access the cluster using a node IP address or private domain name.

    • Click Add to add accounts in Authorized Account ID. If the authorized account ID is set to *, all users are allowed to access the cluster.
    • Click Delete in the Operation column to delete accounts.
    NOTE:

    To obtain your authorized account ID, point to your username in the upper right corner, and choose My Credentials. Copy the value of Account ID.

Managing VPC Endpoint Service for an Existing Cluster

You can enable the VPC endpoint service while creating a cluster, and also enable it by performing the following steps after cluster creation.

  1. Log in to the CSS management console.
  2. Choose Clusters in the navigation pane. On the Clusters page, click the name of the target cluster.
  3. Click the VPC Endpoint Service tab, and turn on the button next to VPC Endpoint Service.
    Table 2 Configuring VPC Endpoint Service

    Parameter

    Description

    Private Domain Name Creation

    If Private Domain Name Creation is selected, the system generates a node IP address and also automatically creates a private domain name, which enables users to access this cluster from within the same VPC. If it is not selected, only a node IP address is generated.

    Create professional endpoints

    Choose whether to create professional endpoints.

    • If unselected, a basic endpoint will be created.
    • If selected, a professional endpoint will be created.
    NOTE:

    If the region where the cluster is located does not support professional endpoints, this option is grayed out. By default, a basic endpoint is created.

    IPv4/IPv6 dual stack network

    Whether to enable IPv4/IPv6 dual-stack networking. This option is available only when IPv6 is enabled for the VPC subnet of the cluster and you have selected Create professional endpoints earlier.

    VPC Endpoint Service Whitelist

    In VPC Endpoint Service Whitelist, you can add accounts that are allowed to access the cluster using a node IP address or private domain name.

    • Click Add to add accounts in Authorized Account ID. If the authorized account ID is set to *, all users are allowed to access the cluster.
    • Click Delete in the Operation column to delete accounts.
    NOTE:

    To obtain your authorized account ID, point to your username in the upper right corner, and choose My Credentials. Copy the value of Account ID.

  4. Manage VPC endpoints.

    The VPC Endpoint Service page displays all VPC endpoints connected to the current cluster. You can obtain the service address and private domain name of VPC endpoints.

    Figure 2 Managing VPC endpoints

    Click Accept or Reject in the Operation column to change the node status. If you reject the connection with a VPC endpoint, you cannot access the cluster through the private domain name generated by that VPC endpoint.

Accessing a Cluster Using a Node IP Address or Private Domain Name

  1. Obtain the cluster's private domain name or node IP address.

    Log in to the CSS console, click the target cluster name and go to the Cluster Information page. Click the VPC Endpoint Service tab and check the service address and private domain name.

    Figure 3 Checking the service address or private domain name of a VPC endpoint
  2. On an ECS, run a cURL command to access the cluster by calling an Elasticsearch API.
    The ECS must meet the following requirements:
    • Sufficient disk space is allocated for the ECS.
    • The ECS and the cluster must be in the same VPC. After enabling the VPC endpoint service, you can access the cluster from the ECS even when the cluster is not in the same VPC as the ECS.
    • The security group of the ECS must be the same as that of the cluster.

      If this requirement is not met, modify the ECS security group or configure the inbound and outbound rules of the ECS security group to allow the ECS security group to be accessed by all security groups of the cluster. For details, see Configuring Security Group Rules.

    • Configure security group rule settings of the target CSS cluster. Set Protocol to TCP and Port Range to 9200 or a port range including port 9200 for both the outbound and inbound directions.

    For example, run the following cURL command to view the index information in the cluster. In this example, the private network address of the cluster is vpcep-7439f7f6-2c66-47d4-b5f3-790db4204b8d.region01.huaweicloud.com, and port 9200 is used.

    • If the cluster you access does not have the security mode enabled, run the following command:
      curl 'http://vpcep-7439f7f6-2c66-47d4-b5f3-790db4204b8d.region01.huaweicloud.com:9200/_cat/indices'
    • If the cluster you access has the security mode enabled, access the cluster using HTTPS and add the username, password and -u to the cURL command.
      curl -u username:password -k 'https://vpcep-7439f7f6-2c66-47d4-b5f3-790db4204b8d.region01.huaweicloud.com:9200/_cat/indices'