All Products
Search
Document Center

Global Accelerator:CreateEndpointGroups

Last Updated:May 08, 2026

Creates endpoint groups in batches.

Operation description

  • Creates endpoint groups in batches. Default and virtual endpoint groups cannot be created in a single call.

  • This API does not support creating virtual endpoint groups for Layer-4 listeners. To create a virtual endpoint group for a Layer-4 listener, call CreateEndpointGroup.

  • CreateEndpointGroups is an asynchronous API. It returns a request ID and creates the endpoint groups in the background. You can call DescribeEndpointGroup or ListEndpointGroups to query the status of an endpoint group:

    • If an endpoint group is in the init state, it is initializing. You can only query the endpoint group in this state.

    • The batch creation is complete when all endpoint groups are in the active state.

  • You cannot make concurrent calls to CreateEndpointGroups for the same Global Accelerator instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ga:CreateEndpointGroups

create

*EndpointGroup

acs:ga:{#regionId}:{#accountId}:endpointgroup/*

*Accelerator

acs:ga:{#regionId}:{#accountId}:ga/{#acceleratorId}

*Listener

acs:ga:{#regionId}:{#accountId}:listener/{#listenerId}

  • ga:AcceleratorMainland
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region where the accelerator is deployed. Set the value to cn-hangzhou.

cn-hangzhou

ClientToken

string

No

The client token used to ensure request idempotence.

You can generate the token on your client. Ensure that it is unique across different requests. The value of ClientToken can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the request as the ClientToken. The RequestId is unique for each API request.

1F4B6A4A-C89E-489E-BAF1-52777EE148EF

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run but does not create the resource. The system checks the required parameters, request format, and service limits. If the request fails the dry run, the system returns an error message. If the request passes the dry run, the system returns a 2xx HTTP status code.

  • false (default): sends a normal request and creates the resource if the request passes.

true

AcceleratorId

string

Yes

The ID of the accelerator.

ga-bp1odcab8tmno0hdq****

ListenerId

string

Yes

The ID of the listener.

Note

If the listener protocol is HTTP or HTTPS, you can create only one endpoint group in each CreateEndpointGroups call.

lsr-bp1bpn0kn908w4nbw****

EndpointGroupConfigurations

array<object>

Yes

The configurations of the endpoint groups.

You can configure up to 10 endpoint groups.

array<object>

No

The configuration of an endpoint group.

EndpointGroupName

string

No

The name of the endpoint group.

The name must be 1 to 128 characters long, start with a letter or a Chinese character, and contain digits, periods (.), underscores (_), and hyphens (-).

group1

EndpointGroupDescription

string

No

The description of the endpoint group.

The description can be up to 200 characters in length and cannot start with http:// or https://.

EndpointGroup

EndpointGroupRegion

string

Yes

The ID of the region where the endpoint group is deployed.

You can enter up to 10 endpoint group region IDs.

cn-hongkong

TrafficPercentage

integer

No

The traffic distribution percentage for the endpoint group. If an intelligent routing listener is associated with multiple endpoint groups, this parameter specifies the percentage of traffic that is routed to this endpoint group.

Valid values: 1 to 100. Default value: 100.

You can enter traffic dial values for up to 10 endpoint groups.

100

HealthCheckEnabled

boolean

No

Specifies whether to enable health checks for the endpoint group. Valid values:

  • true: enables health checks.

  • false (default): disables health checks.

You can enable health checks for up to 10 endpoint groups.

false

HealthCheckIntervalSeconds

integer

No

The interval between health checks, in seconds.

You can enter up to 10 health check intervals.

5

HealthCheckPath

string

No

The path used for health checks.

You can enter up to 10 health check paths.

/healthcheck

HealthCheckPort

integer

No

The port used for health checks. Valid values: 1 to 65535.

You can enter up to 10 ports for health checks.

443

HealthCheckProtocol

string

No

The protocol used for health checks. Valid values:

  • tcp or TCP: TCP protocol.

  • http or HTTP: HTTP protocol.

  • https or HTTPS: HTTPS protocol.

You can enter up to 10 health check protocols.

HTTPS

ThresholdCount

integer

No

The number of consecutive health checks that must succeed for an endpoint to be considered healthy, or fail for it to be considered unhealthy. Valid values: 2 to 10. Default value: 3.

You can enter up to 10 values for the number of consecutive health checks required for a health status change.

3

EndpointConfigurations

array<object>

No

The configurations of the endpoints in the endpoint group.

object

No

The configuration of an endpoint.

Type

string

No

The type of endpoint in an intelligent routing listener. Valid values:

  • Domain: a custom domain name.

  • Ip: a custom IP address.

  • IpTarget: a custom private IP address.

  • PublicIp: an Alibaba Cloud public IP address.

  • ECS: an ECS instance.

  • SLB: an SLB instance.

  • ALB: an ALB instance.

  • OSS: an OSS bucket.

  • ENI: an elastic network interface.

  • NLB: an NLB instance.

In an endpoint group of an intelligent routing listener, you can specify up to 100 endpoints.

Note
  • If the routing type of the listener is Standard (intelligent routing), you must configure the endpoint group and endpoint information for the listener. This parameter is required.

  • If you set Type to ECS, ENI, SLB, or IpTarget and a service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaVpcEndpoint.

  • If you set Type to ALB and a service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaAlb.

  • If you set Type to OSS and a service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaOss.

  • If you set Type to NLB and a service-linked role does not exist, the system automatically creates a service-linked role named AliyunServiceRoleForGaNlb.

Note

For more information, see service-linked roles.

Domain

Weight

integer

No

The weight of the endpoint.

Valid values: 0 to 255.

Note

If you set the weight of an endpoint to 0, Global Accelerator stops distributing traffic to the endpoint. Proceed with caution.

255

Endpoint

string

No

The IP address or domain name of the endpoint.

In an endpoint group of an intelligent routing listener, you can enter a maximum of 100 endpoint IP addresses or domain names.

1.1.1.1

SubAddress

string

No

The private IP address of the elastic network interface (ENI).

Note

This parameter is available only when the endpoint type is ENI. If you do not specify this parameter, the system uses the primary private IP address of the ENI.

172.168.XX.XX

EnableClientIPPreservation

boolean

No

Specifies whether to preserve client IP addresses. Valid values:

  • true: preserves client IP addresses.

  • false (default): does not preserve client IP addresses.

Note
  • For endpoint groups of UDP and TCP listeners, the preserve client IP feature is disabled by default. You can enable this feature based on your business requirements.

  • For endpoint groups of HTTP and HTTPS listeners, the preserve client IP feature is enabled by default. Client IP addresses are preserved in the X-Forwarded-For header. You cannot disable this feature.

  • EnableClientIPPreservation and EnableProxyProtocol cannot be set to true at the same time.

  • For more information, see preserve client IP addresses.

false

EnableProxyProtocol

boolean

No

Specifies whether to use the Proxy Protocol to preserve client IP addresses. Valid values:

  • true: uses the Proxy Protocol to preserve client IP addresses.

  • false (default): does not use the Proxy Protocol to preserve client IP addresses.

Note
  • This parameter is available only for endpoint groups that are associated with TCP listeners.

  • EnableClientIPPreservation and EnableProxyProtocol cannot be set to true at the same time.

  • For more information, see preserve client IP addresses.

false

VpcId

string

No

The ID of the VPC.

In an endpoint group of an intelligent routing listener, you can specify only one VPC ID.

Note

This parameter is required only when you set Type to IpTarget.

vpc-2zekzii824szm3hps****

VSwitchIds

array

No

A list of VSwitch IDs.

string

No

The ID of the VSwitch.

In an endpoint group of an intelligent routing listener, you can specify up to two VSwitch IDs.

Note

This parameter is required and applies only when the endpoint type is IpTarget.

  • The VSwitch must be in the VPC specified by the VpcId parameter.

vsw-bp1b2qx7y2qqnbkan****

Provider

string

No

BAILIAN

ApiKeys

array

No

string

No

sk-******

EndpointRequestProtocol

string

No

The protocol of the backend service. Valid values:

  • HTTP

  • HTTPS

Note
  • You can set this parameter only when you create an endpoint group for an HTTP or HTTPS listener.

  • For an HTTP listener, you can set this parameter only to HTTP.

HTTPS

EndpointProtocolVersion

string

No

The protocol version of the backend service. Valid values:

  • HTTP1.1 (default): HTTP 1.1.

  • HTTP2: HTTP 2.

Note

You can set this parameter only when EndpointRequestProtocol is set to HTTPS.

HTTP1.1

EndpointGroupType

string

No

The type of the endpoint group in an intelligent routing listener. Valid values:

  • default (default): a default endpoint group.

  • virtual: a virtual endpoint group.

You can enter up to 10 endpoint group types.

default

PortOverrides

array<object>

No

The port override settings.

object

No

A port override setting.

ListenerPort

integer

No

The listener port.

Valid values: 1 to 65499.

Note
  • For TCP listeners, you cannot configure port overrides for a virtual endpoint group. If a virtual endpoint group already exists for the listener, you cannot configure port overrides for the default endpoint group. If port overrides are configured for the default endpoint group, you cannot add a virtual endpoint group.

  • After you configure a port override, you cannot change the listener protocol, except for switching between HTTP and HTTPS.

  • When you modify the listener port range, the new range must include all listener ports that are used in the port overrides. For example, if the listener port range is 80-82 and a port override is configured to map listener ports to endpoint ports 100-102, you cannot change the listener port range to 80-81.

80

EndpointPort

integer

No

The endpoint port used for the port override.

443

Tag

array<object>

No

The tags to add to the endpoint group. You can specify up to 20 tags.

object

No

The tags of the endpoint group.

Key

string

No

The key of the tag. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can enter up to 20 tag keys.

tag-key

Value

string

No

The value of the tag. The tag value can be an empty string.

The tag value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can enter up to 20 tag values.

tag-value

SystemTag

array<object>

No

This parameter is reserved.

object

No

This parameter is reserved.

Key

string

No

This parameter is reserved.

-

Value

string

No

This parameter is reserved.

-

Scope

string

No

This parameter is reserved.

-

HealthCheckHost

string

No

The domain name to which health check requests are sent.

www.taobao.com

EndpointIpVersion

string

No

The IP version of the backend service. Valid values:

  • IPv4 (default): Global Accelerator uses only IPv4 addresses to communicate with the backend service.

  • IPv6: Global Accelerator uses only IPv6 addresses to communicate with the backend service.

  • ProtocolAffinity: Global Accelerator communicates with the backend service using the same IP version as the client request.

IPv4

Response elements

Element

Type

Description

Example

object

The returned data.

RequestId

string

The request ID.

6FEA0CF3-D3B9-43E5-A304-D217037876A8

EndpointGroupIds

array

The IDs of the endpoint groups.

string

The ID of an endpoint group.

epg-bp1dmlohjjz4kqaun****

Examples

Success response

JSON format

{
  "RequestId": "6FEA0CF3-D3B9-43E5-A304-D217037876A8",
  "EndpointGroupIds": [
    "epg-bp1dmlohjjz4kqaun****"
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 Domain.NotFit The domain is not fit the rule The domain name does not have an ICP number.
400 Resource.QuotaFull The resource quota is exceeded. The number of resources has reached the upper limit.
400 NoPermission.EnableHealthCheck You do not have permission to enable health check. The current account does not have the permissions to enable health checks.
400 NotSupportHealthCheck.Accelerator Currently Accelerator does not support health check. The current GA instance does not support health checks.
400 EndpointGroupExclusive.Listener All endpoint group must under the same listener. All the endpoint groups must be associated with the same listener.
400 RegionConflict.EndpointGroup Endpoint group under the same listener must have different region. The endpoint groups that are associated with the same listener must be deployed in different regions.
400 ListenerProtocolIllegal.EndpointGroup Listener protocol is illegal, the https/http listener instance is only allowed to have one default endpoint group. You can configure only one default endpoint group for an HTTPS or HTTP listener.
400 QuotaExceeded.EndpointGroup The number of endpoint group exceeds the limit. The number of endpoint groups has reached the upper limit.
400 ParamExclusive.EndpointGroupType All endpoint group type group must be consistent.
400 HealthCheckPath.Illegal Health check path illegal. The health check path is invalid.
400 NotExist.Listener The listener does not exist. The listener does not exist.
400 NotActive.Listener The state of the listener is not active. The listener is unstable.
400 NotExist.Accelerator The accelerated instance does not exist. The GA instance does not exist.
400 StateError.Accelerator The state of the accelerated instance is invalid. The status of the GA instance is invalid.
400 NotExist.BusinessRegion The business region does not exist. The business region does not exist.
400 NotExist.BasicBandwidthPackage You must specify the basic bandwidth package. You must specify the basic bandwidth package.
400 QuotaExceeded.EndPoint The maximum number of endpoints is exceeded. The maximum number of endpoints is exceeded.
400 NoPermission.VpcEndpoint You are not authorized to perform the operation. The user does not have permissions to create service linked roles. Contact the Alibaba Cloud account owner or the permission administrator to grant the current user AliyunGlobalAccelerationFullAccess or create custom permission policies for service linked role. The following content describes the detailed information about custom permission policies: ServiceName: vpcendpoint.ga.aliyuncs.com. Service linked role name: AliyunServiceRoleForGaVpc. Endpoint Permission: ram:CreateServiceLinkedRole.
400 EndPointRequestProtocolIllegal.EndpointGroup endpoint group request protoco is illegal
400 QuotaExceeded.PortOverride The number of port override exceeds the limit. The number of port override exceeds the limit.
400 NotExist.ListenerPort listener port %s is not exist
400 MixedVpc.EndPoint VPC Endpoint cannot be mixed with other types of Endpoints. You cannot use private endpoints with other types of endpoints.
400 IllegalPublicIp.EndPoint The public IP address configured for the endpoint is invalid. Only an Alibaba Cloud public IP address in the region of the endpoint can be configured. The public IP address configured for the endpoint is invalid. Only an Alibaba Cloud public IP address in the region of the endpoint can be configured.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.