All Products
Search
Document Center

Virtual Private Cloud:CreateRouteTargetGroup

Last Updated:Jan 07, 2026
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Create Route Target Group

Operation description

  • The CreateRouteTargetGroup interface is an asynchronous interface, meaning the system will return an instance ID, but the route target group instance has not yet been fully created, and the system's background creation task is still in progress. You can call ListRouteTargetGroup to query the creation status of the route target group:

    • When the route target group is in the Pending state, it indicates that the route target group is being created.
    • When the route target group is in the Available, Unavailable, Switched, or Abnormal state, it indicates that the route target group has been created.
  • Active-Standby Mode: When creating a route target group, you need to configure primary and standby instances that are located in different availability zones and have the same type.

  • Primary Instance: The weight is 100. Under normal circumstances, it carries all traffic and takes effect when the health check is normal.

  • Standby Instance: The weight is 0. It takes over the traffic after the primary instance fails, serving as a disaster recovery backup.

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
vpc:CreateRouteTargetGroupcreate
*RouteTargetGroup
acs:vpc:{#regionId}:{#accountId}:routetargetgroup/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
VpcIdstringYes

The ID of the VPC to which the route target group belongs.

vpc-xxxx
RouteTargetGroupNamestringNo

The name of the route target group.

The name length must be between 1 and 128 characters, and cannot start with http:// or https://.

myRouteTargetGroupName
RouteTargetGroupDescriptionstringNo

The description of the route target group.

The description length must be between 1 and 256 characters, and cannot start with http:// or https://.

myRouteTargetGroupDescription
RouteTargetMemberListarray<object>Yes

The member list of the route target group.

In Active-Standby mode, the following restrictions apply to the members of the route target group:

  1. The number of route target group members must be 2.
  2. The route target group members must belong to different availability zones.
objectYes
MemberIdstringYes

The instance ID of the route target group member.

ep-xxxx
MemberTypestringYes

The type of the route target group member.

Currently supported types:

  • GatewayLoadBalancerEndpoint

In Active-Standby mode, all members of the route target group must have the same type.

GatewayLoadBalancerEndpoint
WeightintegerYes

The weight value of the route target group member. Values:

  • 100: Indicates the member is a primary instance.
  • 0: Indicates the member is a standby instance.

The weight value can only be set during creation and cannot be modified.

100
ConfigModestringYes

The configuration mode of the route target group. Supported modes:

  • Active-Standby: Active-Standby mode.
Active-Standby
RegionIdstringYes

The region ID to which the route target group belongs. You can obtain the region ID by calling the DescribeRegions interface.

cn-hangzhou
ResourceGroupIdstringNo

The resource group ID.

For more information about resource groups, see What is a Resource Group.

rg-acfmxazffggds****
ClientTokenstringNo

Client token used to ensure the idempotence of the request. Generate a parameter value from your client to ensure that it is unique across different requests. ClientToken supports only ASCII characters. Note: If you do not specify this, the system automatically uses the RequestId of the API request as the ClientToken identifier. Each API request has a different RequestId.

0c593ea1-3bea-11e9-b96b-88e9fe6****
Tagarray<object>No

The tags of the resource.

objectNo

The tags of the resource.

KeystringNo

The tag key of the resource. Up to 20 tag keys are supported. If you need to pass this value, you cannot input an empty string.

A tag key can have up to 128 characters and cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceDept
ValuestringNo

The tag value of the resource. Up to 20 tag values are supported. If you need to pass this value, you can input an empty string.

A tag value can have up to 128 characters and cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceJoshua

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

ID of the request.

8AA5CE21-2E6A-4530-BDF5-F055849476E6
RouteTargetGroupIdstring

The ID of the route target group instance.

rtg-xxxx

Examples

Sample success responses

JSONformat

{
  "RequestId": "8AA5CE21-2E6A-4530-BDF5-F055849476E6",
  "RouteTargetGroupId": "rtg-xxxx"
}

Error codes

HTTP status codeError codeError messageDescription
400UnsupportedFeature.RouteTargetGroupThe feature of RouteTargetGroup is not supported.The feature of RouteTargetGroup is not supported.
400Mismatch.GroupVpcIdAndInstanceVpcIdThe RouteTargetGroup VPC %s and the RouteTargetConfig VPC %s are mismatched.The VPC to which the route target group belongs is different from the VPC to which the route target configuration instance belongs.
400OperationDenied.MemberWithSameAzThe operation is not allowed because of all members being in the same availability zone.The operation is not allowed because of all members being in the same availability zone.
400InvalidVpcId.NotFoundSpecified value of VpcId is not found in our record.The VPC does not exist. Check whether the specified VPC is valid.
400ResourceNotFound.GatewayLoadBalancerEndpointGatewayLoadBalancerEndpoint instance %s not found.-
400QuotaExceeded.RouteTargetGroupThe quota of %s is exceeded, usage %s/%s.The quota of %s is exceeded, usage %s/%s.

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

Change history

Change timeSummary of changesOperation
2026-01-04Add OperationView Change Details