Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a VPC Endpoint Service

Updated on 2022-12-06 GMT+08:00

Function

This API is used to create a VPC endpoint service. Other users can create a VPC endpoint to connect to the endpoint service.

NOTE:

This API is an asynchronous interface. If it is successfully invoked, status code 200 is returned, indicating that the request has been successfully delivered. It takes 1 to 2 minutes to create a VPC endpoint service. You can view the creation result by performing operations in Querying Details of a VPC Endpoint Service.

URI

POST /v1/{project_id}/vpc-endpoint-services

Table 1 describes the required parameters.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request

  • Parameter description
    Table 2 Request parameters

    Parameter

    Mandatory

    Type

    Description

    port_id

    Yes

    String

    Specifies the ID for identifying the backend resource of the VPC endpoint service. The ID is in the form of the UUID.

    The values are as follows:

    • If the backend resource is a load balancer, the value is the ID of the port bound to the private IP address of the load balancer. For details, see response field vip_port_id in section "Querying Details of a Load Balancer" in the Elastic Load Balancing API Reference.
    • If the backend resource is an ECS, the value is the NIC ID of the ECS where the VPC endpoint service is deployed. For details, see section "Querying NICs of an ECS" in the Elastic Cloud Server API Reference.
    • If the backend resource is a virtual IP address, the value is the NIC ID of the physical server where virtual resources are created. (This value will not be returned because virtual IP addresses cannot be used. The LB type is recommended.)
    NOTE:
    • To create a VPC endpoint service, the CIDR block of the VPC where the VPC endpoint service is deployed cannot overlap with 198.19.128.0/17.
    • The destination address of the custom route in the VPC route table cannot overlap with 198.19.128.0/17.

    vip_port_id

    No

    String

    Specifies the ID of the virtual NIC to which the virtual IP address is bound.

    service_name

    No

    String

    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 specify this parameter, the VPC endpoint service name is in the format: regionName.serviceId.
    • If you specify this parameter, the VPC endpoint service name is in the format: regionName.serviceName.serviceId.

    vpc_id

    Yes

    String

    Specifies the ID of the VPC to which the backend resource of the VPC endpoint service belongs.

    For details, see response field id in section "Querying VPC Details" in the Virtual Private Cloud API Reference.

    approval_enabled

    No

    Boolean

    Specifies whether connection approval is required.

    • false: Connection approval is not required. The created VPC endpoint is in the Accepted state.
    • true: Connection approval is required. The created VPC endpoint is in the Pending acceptance state until the owner of the associated VPC endpoint service approves the connection.

    The default value is true.

    service_type

    No

    String

    Specifies the type of the VPC endpoint service. Only your private services can be configured into interface VPC endpoint services.

    There are two types of VPC endpoint services: interface and gateway.
    • Gateway: VPC endpoint services of this type are configured by operations people. You can use them directly without the need to create one by yourselves.
    • Interface: VPC endpoint services of this type include cloud services configured by operations people and private services created by yourselves. You cannot configure these cloud services, but can use them.

    You can view those VPC endpoint services that are configured by operations people and are visible and accessible to all users. For detailed steps, see Querying Public VPC Endpoint Services. Perform the operations in Creating a VPC Endpoint to create VPC endpoints for accessing VPC endpoint services of the gateway type and interface type.

    server_type

    Yes

    String

    Specifies the resource type.

    • VM: Select this value if the backend resource is an ECS. Backend resources of this type serve as servers.
    • VIP: Select this value if the backend resource is a virtual IP address that functions as a physical server hosting virtual resources. (This value will not be returned because virtual IP addresses cannot be used. The LB type is recommended.)
    • LB: Select this value if the backend resource is a load balancer. Backend resources of this type suit services that receive high access traffic and demand high reliability and disaster recovery (DR) performance.

    ports

    Yes

    Array of objects

    Lists the port mappings opened to the VPC endpoint service. For details, see Table 3.

    Duplicate port mappings are not allowed in the same VPC endpoint service. If multiple VPC endpoint services share the same port_id value, service ports and terminal ports of all these endpoint services cannot be duplicated when the protocol is the same. A maximum of 200 port mappings can be created at a time.

    tcp_proxy

    No

    String

    Specifies whether the client IP address and port number or marker_id information is transmitted to the server. The following methods are supported:

    • TCP TOA: The client information is inserted into field tcp option and transmitted to the server.
      NOTE:

      TCP TOA is supported only when the backend resource is OBS.

    • Proxy Protocol: The client information is inserted into field tcp payload and transmitted to the server.

    This parameter is available only when the server can parse fields tcp option and tcp payload.

    The values are as follows:

    • close: The TOA and Proxy Protocol methods are neither used.
    • toa_open: The TOA method is used.
    • proxy_open: The Proxy Protocol method is used.
    • open: The TOA and Proxy Protocol methods are both used.
    • proxy_vni: The TOA Protocol method is not used. Proxy and virtual network ID are used.

    The default value is close.

    tags

    No

    Array of objects

    Lists the resource tags. For details, see Table 4.

    A maximum of 10 tags can be added to each VPC endpoint service.

    Table 3 Port mapping parameters

    Parameter

    Mandatory

    Type

    Description

    client_port

    No

    Integer

    Specifies the port for accessing the VPC endpoint.

    This port is provided by the VPC endpoint, allowing you to access the VPC endpoint service. Supported range: 1 to 65535

    server_port

    No

    Integer

    Specifies the port for accessing the VPC endpoint service.

    This port is provided by the backend service to provide services. Supported range: 1 to 65535

    protocol

    No

    String

    Specifies the protocol used in port mappings. The protocol can be TCP.

    Table 4 ResourceTags parameters

    Parameter

    Mandatory

    Type

    Description

    key

    No

    String

    Specifies the tag key. A tag key contains a maximum of 36 Unicode characters. This parameter cannot be left blank. It cannot contain characters =*<>\,|/ nor start or end with a space.

    value

    No

    String

    Specifies the tag value. A tag value contains a maximum of 43 Unicode characters and can be left blank. It cannot contain characters =*<>\,|/ nor start or end with a space.

  • Example request
    POST https://{endpoint}/v1/{project_id}/vpc-endpoint-services
    {
       "port_id":"4189d3c2-8882-4871-a3c2-d380272eed88",
       "vpc_id":"4189d3c2-8882-4871-a3c2-d380272eed80",
       "approval_enabled":false,
       "service_type":"interface",
       "server_type":"VM",
       "ports":
      [
        {
          "client_port":8080,
          "server_port":90,
          "protocol":"TCP"
        },
        {
          "client_port":8081,
          "server_port":80,
          "protocol":"TCP"
        }
      ]
    }

Response

  • Parameter description
    Table 5 Response parameters

    Parameter

    Type

    Description

    id

    String

    Specifies the unique ID of the VPC endpoint service.

    port_id

    String

    Specifies the ID for identifying the backend resource of the VPC endpoint service. The ID is in the form of the UUID. The values are as follows:

    • If the backend resource is a load balancer, the value is the ID of the port bound to the private IP address of the load balancer.
    • If the backend resource is an ECS, the value is the NIC ID of the ECS where the VPC endpoint service is deployed.
    • If the backend resource is a virtual IP address, the value is the NIC ID of the physical server where virtual resources are created. (This value will not be returned because virtual IP addresses cannot be used. The LB type is recommended.)

    vip_port_id

    String

    Specifies the ID of the virtual NIC to which the virtual IP address is bound.

    This parameter is returned only when the backend resource of the VPC endpoint service is a virtual IP address. If the virtual IP address cannot be used for VPCEP, this parameter is not returned.

    service_name

    String

    Specifies the name of the VPC endpoint service.

    service_type

    String

    Specifies the type of the VPC endpoint service.

    There are two types of VPC endpoint services: interface and gateway.
    • Gateway: VPC endpoint services of this type are configured by operations people. You can use them directly without the need to create one by yourselves.
    • Interface: VPC endpoint services of this type include cloud services configured by operations people and private services created by yourselves. You cannot configure these cloud services, but can use them.

    You can perform the operations in Creating a VPC Endpoint to create VPC endpoints for accessing VPC endpoints of the gateway and interface types.

    server_type

    String

    Specifies the resource type.

    • VM: indicates the ECS.
    • VIP: indicates the virtual IP address. (This value will not be returned because virtual IP addresses cannot be used. The LB type is recommended.)
    • LB: shared load balancer

    vpc_id

    String

    Specifies the ID of the VPC to which the backend resource of the VPC endpoint service belongs.

    approval_enabled

    Boolean

    Specifies whether connection approval is required.

    • false: Connection approval is not required. The created VPC endpoint is in the Accepted state.
    • true: Connection approval is required. The created VPC endpoint is in the Pending acceptance state until the owner of the associated VPC endpoint service approves the connection.

    status

    String

    Specifies the status of the VPC endpoint service.

    • creating: The VPC endpoint service is being created.
    • available: The VPC endpoint service is connectable.
    • failed: The VPC endpoint service failed to be created.

    created_at

    String

    Specifies the creation time of the VPC endpoint service.

    The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ.

    updated_at

    String

    Specifies the update time of the VPC endpoint service.

    The UTC time format is used: YYYY-MM-DDTHH:MM:SSZ.

    project_id

    String

    Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

    ports

    Array of objects

    Lists the port mappings opened to the VPC endpoint service. For details, see Table 6.

    Duplicate port mappings are not allowed in the same VPC endpoint service. If multiple VPC endpoint services share the same port_id value, service ports and terminal ports of all these endpoint services cannot be duplicated when the protocol is the same.

    tcp_proxy

    String

    Specifies whether the client IP address and port number or marker_id information is transmitted to the server. The following methods are supported:

    • TCP TOA: The client information is inserted into field tcp option and transmitted to the server.
      NOTE:

      TCP TOA is supported only when the backend resource is OBS.

    • Proxy Protocol: The client information is inserted into field tcp payload and transmitted to the server.

    This parameter is available only when the server can parse fields tcp option and tcp payload.

    The values are as follows:

    • close: The TOA and Proxy Protocol methods are neither used.
    • toa_open: The TOA method is used.
    • proxy_open: The Proxy Protocol method is used.
    • open: The TOA and Proxy Protocol methods are both used.
    • proxy_vni: The TOA Protocol method is not used. Proxy and virtual network ID are used.

    The default value is close.

    tags

    Array of objects

    Lists the resource tags. For details, see Table 7.

    Table 6 Port mapping parameters

    Parameter

    Type

    Description

    client_port

    Integer

    Specifies the port for accessing the VPC endpoint.

    This port is provided by the VPC endpoint, allowing you to access the VPC endpoint service. Supported range: 1 to 65535

    server_port

    Integer

    Specifies the port for accessing the VPC endpoint service.

    This port is provided by the backend service to provide services. Supported range: 1 to 65535

    protocol

    String

    Specifies the protocol used in port mappings. The protocol can be TCP.

    Table 7 ResourceTags parameters

    Parameter

    Type

    Description

    key

    String

    Specifies the tag key. A tag key contains a maximum of 36 Unicode characters. This parameter cannot be left blank. It cannot contain characters =*<>\,|/ nor start or end with a space.

    value

    String

    Specifies the tag value. A tag value contains a maximum of 43 Unicode characters and can be left blank. It cannot contain characters =*<>\,|/ nor start or end with a space.

  • Example response
    {
        "id":"4189d3c2-8882-4871-a3c2-d380272eed83",
        "port_id":"4189d3c2-8882-4871-a3c2-d380272eed88",
        "vpc_id":"4189d3c2-8882-4871-a3c2-d380272eed80",
        "status":"available",
        "approval_enabled":false,
        "service_name":"test123",
        "service_type":"interface",
        "server_type":"VM",
        "project_id":"6e9dfd51d1124e8d8498dce894923a0d",
        "created_at":"2018-01-30T07:42:01Z",
        "ports":
                  [
                    {
                        "client_port":8080,
                        "server_port":90,
                        "protocol":"TCP"
                    },
                    {
                        "client_port":8081,
                        "server_port":80,
                        "protocol":"TCP"
                    }
                  ]
    }

Status Code

For details about status codes, see Status Code.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback