Help Center/ VPC Endpoint/ Getting Started/ Configuring a VPC Endpoint for Communications Between VPCs in the Same Account
Updated on 2026-01-19 GMT+08:00

Configuring a VPC Endpoint for Communications Between VPCs in the Same Account

Solution Overview

VPC Endpoint allows you to access resources across VPCs within the same region.

Normally, cloud resources in different VPCs are isolated from each other and cannot be accessed using private IP addresses, VPC Endpoint bridges this gap by enabling you to use a private IP address to access resources across two VPCs.

This section describes how cloud resources in a VPC use a VPC endpoint to access the service in another VPC from the same account in the same region.

As shown in the following figure, VPC 1 and VPC 2 belong to the same account in the same region. You can configure a load balancer in VPC 2 as a VPC endpoint service and buy a VPC endpoint in VPC 1. Then the ECS in VPC 1 can access the load balancer in VPC 2 using a private IP address.

Procedure

Step

Description

Preparations

Before using VPC Endpoint, you need to sign up for a HUAWEI ID, enable Huawei Cloud services, and complete real-name authentication.

Step 1: Create a VPC Endpoint Service

To connect a VPC to another, you first need to configure a cloud resource (backend resource) in one VPC as a VPC endpoint service.

Step 2: Buy a VPC Endpoint

After you configure a VPC endpoint service, you also need to buy a VPC endpoint to access the VPC endpoint service.

Preparations

Sign up for a HUAWEI ID and enable Huawei Cloud services.

VPC Endpoint is not available on the Huawei Cloud application. You can only use it on the Huawei Cloud management console.

Step 1: Create a VPC Endpoint Service

To connect a VPC to another, you first need to configure a cloud resource (backend resource) in one VPC as a VPC endpoint service.

The following shows how you can configure a load balancer as a VPC endpoint service.
  1. Go to the VPC endpoint service list page.
  2. Click Create VPC Endpoint Service.

    The Create VPC Endpoint Service page is displayed.

  3. Configure required parameters.
    Table 1 Parameters for creating a VPC endpoint service

    Parameter

    Example Value

    Description

    Region

    EU-Dublin

    Specifies the region where the VPC endpoint service is to be deployed.

    Resources in different regions cannot communicate with each other over an intranet. For lower latency and faster access, select the region nearest to where your services will be accessed.

    Name (Optional)

    -

    Specifies the name of the VPC endpoint service.

    The name can contain a maximum of 16 characters, including letters, digits, underscores (_), and hyphens (-).

    • If you do not enter a name, the system generates a name in {region}.{service_id} format.
    • If you enter a name, the system generates a name in {region}.{Name}.{service_id} format.

    VPC

    -

    Specifies the VPC where the VPC endpoint service is to be deployed.

    Service Type

    Interface

    Specifies the type of the VPC endpoint service.

    The default value is Interface.

    Connection Approval

    -

    Specifies whether the connection between a VPC endpoint and a VPC endpoint service requires approval from the owner of the VPC endpoint service.

    You can enable or disable Connection Approval.

    When Connection Approval is enabled, any access from the VPC endpoint to the VPC endpoint service needs to be approved. For detailed operations, see 6.

    Backend Resource Type

    Elastic load balancer

    Specifies the type of the backend resource that provides services to be accessed.

    The following backend resource types are supported:

    • Elastic load balancer: works well for services that need to handle heavy traffic and require strong reliability and effective disaster recovery.
    • ECS: serves as a server.
    • BMS: serves as a server.
    In this example, select Elastic load balancer.
    NOTE:
    • For the security group associated with the backend resource configured for the VPC endpoint service, add an inbound rule, with Source set to 198.19.128.0/17, to allow inbound traffic. For details, see Adding a Security Group Rule in the Virtual Private Cloud User Guide.
    • If you configure a load balancer as the backend resource for the VPC endpoint service, and enable access control for the listener associated with the load balancer, ensure there is a rule that allows traffic from 198.19.128.0/17.

    Load Balancer

    -

    Specifies the load balancer that will provide services. When Backend Resource Type is set to Elastic load balancer, select a load balancer from the drop-down list.

    NOTE:

    If a load balancer is used as the backend resource, the client IP address cannot be obtained.

    Port Mapping

    80

    Specifies the protocol and ports used for communications between the VPC endpoint service and a VPC endpoint. The protocol can be TCP.

    • Service Port: a port used by the VPC endpoint service to provide services.
    • Endpoint Port: a VPC endpoint port for you to access a VPC endpoint service.

    The service and endpoint port numbers range from 1 to 65535. A maximum of 50 port mappings can be added at a time.

    NOTE:

    Accessing a VPC endpoint service from a VPC endpoint is to access the service port from the associated endpoint port.

    If you need to run an SSH command to verify the connectivity after the configuration is complete, set Service Port to 22 according to the SSH protocol.

    Tag (Optional)

    example_key1

    example_value1

    Specifies the tags that will be used to classify and identify the VPC endpoint service.

    You can modify this parameter after the VPC endpoint service is created.

    Description (Optional)

    -

    Provides supplementary information about the VPC endpoint service.

    Table 2 Tag requirements for VPC endpoint services

    Parameter

    Requirement

    Key

    • Cannot be left blank.
    • Must be unique for each resource.
    • Can contain a maximum of 128 characters.
    • Can contain letters, digits, spaces, and any of the following characters _.:=+-@. It cannot start or end with a space, or start with _sys_.

    Value

    • Can be left blank.
    • Can contain a maximum of 255 characters.
    • Can contain letters, digits, spaces, and any of the following characters: _.:=+-@. It cannot start or end with a space.
  4. Click Create Now.

    Return to the VPC endpoint service list and check the new VPC endpoint service.

Step 2: Buy a VPC Endpoint

After you create a VPC endpoint service, you also need to buy a VPC endpoint to access the VPC endpoint service.

This section describes how to buy a VPC endpoint in another VPC of your own account.

Select the same region and project as those of the VPC endpoint service to be accessed.

  1. Go to the VPC endpoint list page.
  2. On the VPC Endpoints page, click Buy VPC Endpoint.

    The Buy VPC Endpoint page is displayed.

  3. Configure required parameters.
    Table 3 Parameters for configuring a VPC endpoint

    Parameter

    Example Value

    Description

    Region

    EU-Dublin

    Specifies the region where the VPC endpoint will be deployed. Select the region where the VPC endpoint service is created.

    Billing Mode

    Pay-per-use

    Specifies the billing mode of the VPC endpoint. You are billed by how long you use each VPC endpoint. VPC endpoints can be used or deleted at any time.

    Only pay-per-use billing is supported.

    Service Category

    Find a service by name

    There are two options:

    • Cloud services: Select it if the target VPC endpoint service is a cloud service.
    • Find a service by name: Select it if the target VPC endpoint service is your private service.

    In this example, select Find a service by name.

    VPC Endpoint Service Name

    -

    This parameter is available only when you select Find a service by name for Service Category.

    Enter the name of the VPC endpoint service and click Verify.

    • If the service is found, proceed with subsequent operations.
    • If the service is not found, check whether the region is the same as that of the VPC endpoint service or whether the name entered is correct.

    Create a Private Domain Name

    -

    If you want to access a VPC endpoint using a domain name, select Create a Private Domain Name.

    This parameter is mandatory when the VPC endpoint will be used to access an interface VPC endpoint service.

    VPC

    -

    Specifies the VPC where the VPC endpoint is to be deployed.

    Subnet

    -

    This parameter is available only when you create a VPC endpoint for accessing an interface VPC endpoint service.

    Specifies the subnet where the VPC endpoint is to be deployed.

    Access Control

    Enable

    This parameter is available only when you create a VPC endpoint for accessing an interface VPC endpoint service.

    You can specify IP addresses and CIDR blocks that are allowed to access the VPC endpoint.

    • If Access Control is enabled, only IP addresses and CIDR blocks in the whitelist are allowed to access the VPC endpoint.
    • If Access Control is disabled, any IP address and CIDR block can access the VPC endpoint.

    Whitelist

    -

    This parameter is available only when you create a VPC endpoint for accessing an interface VPC endpoint service.

    You can specify the IP addresses and CIDR blocks that are allowed to access the VPC endpoint. You can add a maximum of 20 records.

    Tag (Optional)

    example_key1

    example_value1

    Specifies the tags that will be used to classify and identify the VPC endpoint.

    This parameter can be modified after you buy a VPC endpoint.

    Description (Optional)

    -

    Provides supplementary information about the VPC endpoint.

    Table 4 Tag requirements for VPC endpoints

    Parameter

    Requirement

    Tag key

    • Cannot be left blank.
    • Must be unique for each resource.
    • Can contain a maximum of 128 characters.
    • Can contain letters, digits, spaces, and any of the following characters: _.:=+-@. It cannot start or end with a space, or start with _sys_.

    Tag value

    • Can be left blank.
    • Can contain a maximum of 255 characters.
    • Can contain letters, digits, spaces, and any of the following characters: _.:=+-@. It cannot start or end with a space.
  4. Click Next.
  5. Confirm the VPC endpoint information and click Submit.
  6. Manage the connection of the VPC endpoint.
    If the status of the VPC endpoint changes to Accepted, the VPC endpoint is connected to the target VPC endpoint service. If the status is Pending acceptance, connection approval is enabled for the VPC endpoint service. You need to perform the following operations:
    1. Locate the VPC endpoint service and click its name.
    2. On the displayed page, select the Connection Management tab.
      • Locate the VPC endpoint and click Accept in the Operation column to allow the access from the VPC endpoint.
      • Locate the VPC endpoint and click Reject in the Operation column to block the access from the VPC endpoint.
    3. Go back to the VPC endpoint list and check whether the status of the VPC endpoint changes to Accepted. If yes, the VPC endpoint is connected to the VPC endpoint service.

Verify Connectivity

Remotely log in to an ECS in VPC 1 by running an SSH command and access the private IP address or private domain name of the VPC endpoint, as shown in the following figure.

ssh -p <endpoint-port> <IP-address-of-the-VPC-endpoint>

According to the SSH protocol, you need to set the service port to 22 in Step 1: Create a VPC Endpoint Service; otherwise, the SSH command cannot be used for verifying connectivity.