All Products
Search
Document Center

PrivateLink:CreateVpcEndpoint

Last Updated:Feb 13, 2025

Creates an endpoint.

Operation description

CreateVpcEndpoint is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the GetVpcEndpointAttribute operation to check whether the endpoint is created.

  • If the endpoint is in the Creating state, the endpoint is being created.
  • If the endpoint is in the Active state, the endpoint is created.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
privatelink:CreateVpcEndpointcreate
*VpcEndpoint
acs:privatelink:{#regionId}:{#accountId}:vpcendpoint/*
*SecurityGroup
acs:ecs:{#regionId}:{#accountId}:securitygroup/{#SecurityGroupId}
*VSwitch
acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}
*VPC
acs:vpc:{#regionId}:{#accountId}:vpc/{#VpcId}
  • privatelink:VpcEndpointServiceId
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the endpoint.

You can call the DescribeRegions operation to query the most recent region list.

cn-huhehaote
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

0c593ea1-3bea-11e9-b96b-88e9fe637760
DryRunbooleanNo

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
false
EndpointNamestringNo

The name of the endpoint.

The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). The name must start with a letter.

test
EndpointTypestringNo

The endpoint type. Valid values:

  • Interface You can specify an Application Load Balancer (ALB) instance, a Classic Load Balancer (CLB) instance, or a Network Load Balancer (NLB) instance.
  • Reverse You can specify a Virtual Private Cloud (VPC) NAT gateway.
Note Services that support reverse endpoints are provided by Alibaba Cloud or Alibaba Cloud partners. To create such a service on your own, contact your account manager.
Interface
ZonePrivateIpAddressCountlongNo

The number of private IP addresses that are assigned to an elastic network interface (ENI) in each zone. Set the value to 1.

1
EndpointDescriptionstringNo

The description of the endpoint.

The description must be 2 to 256 characters in length, and cannot start with http:// or https://.

This is my Endpoint.
VpcIdstringYes

The ID of the virtual private cloud (VPC) to which the endpoint belongs.

vpc-hp356stwkxg3fn2xe****
ServiceIdstringYes

The ID of the endpoint service with which the endpoint is associated.

epsrv-hp3xdsq46ael67lo****
ServiceNamestringNo

The name of the endpoint service with which the endpoint is associated.

com.aliyuncs.privatelink.cn-huhehaote.epsrv-hp3vpx8yqxblby3i****
Zonearray<object>No

The zones where the endpoint is deployed.

objectNo

The ID of the zone in the current region.

Resources are deployed in the specified zone.

VSwitchIdstringNo

The ID of the vSwitch for which you want to create the endpoint elastic network interface (ENI) in the zone. You can specify up to 10 vSwitches.

vsw-hp3uf6045ljdhd5zr****
ZoneIdstringNo

The ID of the zone where the endpoint service is deployed.

You can specify up to 10 zones.

cn-huhehaote-b
ipstringNo

The IP address of the zone where the endpoint is deployed.

192.168.XX.XX
Ipv6AddressstringNo

The IPv6 address of the zone where the endpoint is deployed.

Note You can specify this parameter only if AddressIpVersion is set to DualStack.
2408:4005:34d:****:a58b:62a3:6b55:****
SecurityGroupIdarrayNo

The IDs of security groups that are associated with the endpoint elastic network interface (ENI).

stringNo

The ID of the security group that is associated with the endpoint ENI. The security group can be used to control data transfer between the virtual private cloud (VPC) and the endpoint ENI.

sg-bp1fg655nh68xyz9****
ProtectedEnabledbooleanNo

Specifies whether to enable user authentication. This parameter is available in Security Token Service (STS) mode. Valid values:

  • true: enables user authentication. After user authentication is enabled, only the user who creates the endpoint can modify or delete the endpoint in STS mode.
  • false (default): disables user authentication.
false
Tagarray<object>No

The tags to add to the resource.

objectNo
KeystringNo

The key of the tag to add to the resource.

env
ValuestringNo

The value of the tag to add to the resource.

prod
ResourceGroupIdstringNo

The resource group ID.

rg-acfmy*****
AddressIpVersionstringNo

The protocol. Valid values:

  • IPv4 (default)
  • DualStack
Note An endpoint supports dual-stack if its associated endpoint service and VPC both support dual-stack.
IPv4

Response parameters

ParameterTypeDescriptionExample
object
EndpointDomainstring

The domain name of the endpoint.

ep-hp33b2e43fays7s8****.epsrv-hp3xdsq46ael67lo****.cn-huhehaote.privatelink.aliyuncs.com
RequestIdstring

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0
CreateTimestring

The time when the endpoint was created.

2022-01-02T19:11:12Z
EndpointBusinessStatusstring

The service state of the endpoint. Valid values:

  • Normal: The endpoint runs as expected.
  • FinancialLocked: The endpoint is locked due to overdue payments.
Normal
EndpointDescriptionstring

The description of the endpoint.

This is my Endpoint.
ServiceIdstring

The ID of the endpoint service with which the endpoint is associated.

epsrv-hp3vpx8yqxblby3i****
EndpointStatusstring

The state of the endpoint. Valid values:

  • Creating: The endpoint is being created.
  • Active: The endpoint is available.
  • Pending: The endpoint is being modified.
  • Deleting: The endpoint is being deleted.
Active
VpcIdstring

The ID of the VPC to which the endpoint belongs.

vpc-hp356stwkxg3fn2xe****
EndpointNamestring

The name of the endpoint.

test
ServiceNamestring

The name of the endpoint service with which the endpoint is associated.

com.aliyuncs.privatelink.cn-huhehaote.epsrv-hp3xdsq46ael67lo****
Bandwidthlong

The bandwidth of the endpoint connection. Unit: Mbit/s.

200
EndpointIdstring

The endpoint ID.

ep-hp33b2e43fays7s8****
ConnectionStatusstring

The state of the endpoint connection. Valid values:

  • Pending: The connection is being modified.
  • Connecting: The connection is being established.
  • Connected: The connection is established.
  • Disconnecting: The endpoint is being disconnected from the endpoint service.
  • Disconnected: The endpoint is disconnected from the endpoint service.
  • Deleting: The connection is being deleted.
Disconnected
AddressIpVersionstring

The protocol. Valid values:

  • IPv4 (default)
  • DualStack
IPv4

Examples

Sample success responses

JSONformat

{
  "EndpointDomain": "ep-hp33b2e43fays7s8****.epsrv-hp3xdsq46ael67lo****.cn-huhehaote.privatelink.aliyuncs.com",
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "CreateTime": "2022-01-02T19:11:12Z",
  "EndpointBusinessStatus": "Normal",
  "EndpointDescription": "This is my Endpoint.",
  "ServiceId": "epsrv-hp3vpx8yqxblby3i****",
  "EndpointStatus": "Active",
  "VpcId": "vpc-hp356stwkxg3fn2xe****",
  "EndpointName": "test",
  "ServiceName": "com.aliyuncs.privatelink.cn-huhehaote.epsrv-hp3xdsq46ael67lo****",
  "Bandwidth": 200,
  "EndpointId": "ep-hp33b2e43fays7s8****",
  "ConnectionStatus": "Disconnected",
  "AddressIpVersion": "IPv4"
}

Error codes

HTTP status codeError codeError messageDescription
400EndpointExistThe specified Endpoint already exists.The specified Endpoint already exists.
400EndpointZoneDuplicatedThe zone is duplicated for the Endpoint.The zone is duplicated for the Endpoint.
400EndpointServiceNotFoundThe specified Service does not exist.The specified Service does not exist.
400EndpointServiceNotSupportedZoneThe specified endpoint service does not support the zone.The specified endpoint service does not support the zone.
400VSwitchNotFoundThe specified VSwitch does not exist.The vSwitch is not found.
400SecurityGroupNotFoundThe specified security group does not exist.The specified security group does not exist.
400VpcTunnelNotFoundThe specified VPC tunnel does not exist.The specified VPC tunnel does not exist.
400VpcNotFoundThe specified VPC does not exist.The specified VPC does not exist.
400GenerateResourceIdFailedFailed to generate ResourceId.Failed to generate ResourceId.
400QuotaMisMatchedThe resource you applied for has exceeded the quota.The resource you applied for has exceeded the quota.
400EndpointMustContainSecurityGroupThe specified endpoint must have at least one security group.The specified endpoint must have at least one security group.
400EndpointDuplicatedThe endpoint of the service already exists and cannot be created again.-
400EndpointServiceDeletedThe specified Service is already deleted.The specified Service is already deleted.
400EndpointServiceResourceNotFoundThe specified service resource is not found.-
400SecurityGroupTypeNotSupportThe specified security group type is not supported.-
400EniIpUnavailableThe specified IP address is unavailable.The specified IP address is unavailable.
400EndpointServiceNotAuthorizedThe specified endpoint service is not authorized to user.The specified endpoint service is not authorized to user.
400SecurityGroupTypeOnlySingleTypeSupportededThe specified security group only support one type.-
400QuotaExceeded.IpQuotaPerEpThe quota of %s is exceeded, usage %s/%s.-
400Mismatch.EndpointTypeThe %s is mismatched for %s and %s.-
400IncorrectStatus.VpcEndpointServiceThe status of %s [%s] is incorrect.-
400CheckServiceLinkRoleErrorThe ServiceLink role check error.ServiceLinkRole check error
400ResourceNotEnough.VSwitchIpThe specified resource of VSwitchIp is not enough.The number of vSwitch IP addresses is insufficient.
400VSwitchStatusNotAllowedThe specified vswitch status is not Available.The status of the vSwitch is not available.
400QuotaExceeded.epZonePerEndpointThe quota of %s is exceeded, usage %s/%s.The number of endpoints in a zone has reached the upper limit.
400QuotaExceeded.totalEpPerVpcThe quota of %s is exceeded, usage %s/%s.The number of VPC endpoints has reached the upper limit.
400QuotaExceeded.totalIdleEndpointThe quota of %s is exceeded, usage %s/%s.The total number of idle endpoints has reached the upper limit.
400OperationDenied.EndpointPolicyNotSupportThe operation is not allowed because of EndpointPolicyNotSupport.-
400OperationDenied.PrivateDomainStatusNotSupportThe operation is not allowed because of %s.-
400OperationDenied.PrivateDomainNotSupportThe operation is not allowed because of PrivateDomainNotSupport.-
400DependencyViolation.PrivateDnsNameThe specified resource of %s depends on %s, so the operation cannot be completed.-
400GatewayLoadBalancerNotSupportSecurityGroupThe gateway load balancer not support security group.The gateway load balancer type does not support setting a security group.
400GatewayLoadBalancerZoneCountDenyThe GatewayLoadBalancer zone count not supportThe number of available zones does not meet the limit and cannot be operated.
400OperationDenied.EndpointTypeNotSupportDualstackThe specified endpoint type does not support dualstack, only the Interface and GatewayLoadBalancer types support dual stack.The specified endpoint type does not support dualstack, only the Interface and GatewayLoadBalancer types support dual stack.
400OperationDenied.EndpointServiceNotSupportDualstackThe specified endpoint service does not support dualstack.The specified endpoint service does not support dualstack.
400OperationDenied.VSwitchNotSupportDualstackThe specified VSwitch does not support dualstack.The specified VSwitch does not support dualstack.
400OperationDenied.AddressIpVersionNotSupportSpecifyIpv6The AddressIpVersion of the endpoint does not support specifying IPv6 address.The AddressIpVersion of the endpoint does not support specifying an IPv6 address.
400IllegalParam.IpThe specified parameter IP is invalid.The specified parameter IP is invalid.
400IllegalParam.Ipv6AddressThe specified parameter Ipv6Address is invalid.The specified parameter Ipv6Address is invalid.
400IllegalParam.AddressIpVersionThe specified parameter AddressIpVersion is invalid.The specified parameter AddressIpVersion does not meet the requirements.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-09-18The Error code has changedView Change Details
2024-09-12The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-05-10The Error code has changed. The request parameters of the API has changedView Change Details
2024-04-08The Error code has changedView Change Details
2023-09-26The Error code has changed. The request parameters of the API has changedView Change Details
2023-09-19The Error code has changedView Change Details
2023-09-05The Error code has changed. The request parameters of the API has changedView Change Details
2022-11-30API Description Update. The Error code has changed. The request parameters of the API has changedView Change Details
2022-11-02The Error code has changedView Change Details
2022-09-20The Error code has changed. The request parameters of the API has changedView Change Details
2022-07-26The Error code has changedView Change Details
2021-12-03The Error code has changedView Change Details