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
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| vpc:CreateRouteTargetGroup | create | *RouteTargetGroup acs:vpc:{#regionId}:{#accountId}:routetargetgroup/* |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| VpcId | string | Yes | The ID of the VPC to which the route target group belongs. | vpc-xxxx |
| RouteTargetGroupName | string | No | 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 |
| RouteTargetGroupDescription | string | No | 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 |
| RouteTargetMemberList | array<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:
| |
| object | Yes | |||
| MemberId | string | Yes | The instance ID of the route target group member. | ep-xxxx |
| MemberType | string | Yes | The type of the route target group member. Currently supported types:
In Active-Standby mode, all members of the route target group must have the same type. | GatewayLoadBalancerEndpoint |
| Weight | integer | Yes | The weight value of the route target group member. Values:
The weight value can only be set during creation and cannot be modified. | 100 |
| ConfigMode | string | Yes | The configuration mode of the route target group. Supported modes:
| Active-Standby |
| RegionId | string | Yes | The region ID to which the route target group belongs. You can obtain the region ID by calling the DescribeRegions interface. | cn-hangzhou |
| ResourceGroupId | string | No | The resource group ID. For more information about resource groups, see What is a Resource Group. | rg-acfmxazffggds**** |
| ClientToken | string | No | 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**** |
| Tag | array<object> | No | The tags of the resource. | |
| object | No | The tags of the resource. | ||
| Key | string | No | 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 | FinanceDept |
| Value | string | No | 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 | FinanceJoshua |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "8AA5CE21-2E6A-4530-BDF5-F055849476E6",
"RouteTargetGroupId": "rtg-xxxx"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | UnsupportedFeature.RouteTargetGroup | The feature of RouteTargetGroup is not supported. | The feature of RouteTargetGroup is not supported. |
| 400 | Mismatch.GroupVpcIdAndInstanceVpcId | The 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. |
| 400 | OperationDenied.MemberWithSameAz | The 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. |
| 400 | InvalidVpcId.NotFound | Specified value of VpcId is not found in our record. | The VPC does not exist. Check whether the specified VPC is valid. |
| 400 | ResourceNotFound.GatewayLoadBalancerEndpoint | GatewayLoadBalancerEndpoint instance %s not found. | - |
| 400 | QuotaExceeded.RouteTargetGroup | The 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 time | Summary of changes | Operation |
|---|---|---|
| 2026-01-04 | Add Operation | View Change Details |
