Creates an Application Load Balancer (ALB) instance in a region.
Operation description
CreateLoadBalancer 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 GetLoadBalancerAttribute operation to query the status of an ALB instance.
- If an ALB instance is in the Provisioning state, it indicates that the ALB instance is being created.
- If an ALB instance is in the Active state, it indicates that the ALB instance is created.
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:
- The required resource types are displayed in bold characters.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
alb:CreateLoadBalancer | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters. Note
If you do not specify this parameter, the system uses the value of RequestId as the value of ClientToken. The value of the RequestId parameter may be different for each API request.
| 5A2CFF0E-5718-45B5-9D4D-70B3FF3898 |
DryRun | boolean | No | Specifies whether to perform a dry run. Default value: false. Valid values:
| false |
VpcId | string | Yes | The ID of the virtual private cloud (VPC) in which you want to create the ALB instance. | vpc-bp1b49rqrybk45nio**** |
AddressType | string | Yes | The type of the address of the ALB instance. Valid values:
| Internet |
LoadBalancerName | string | No | The name of the ALB instance. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter. | alb1 |
DeletionProtectionEnabled | boolean | No | Specifies whether to enable deletion protection. Default value: false. Valid values:
| false |
ModificationProtectionConfig | object | No | The configuration of the configuration read-only mode. | |
Reason | string | No | The reason for enabling the configuration read-only mode. The reason must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The reason must start with a letter. Note
This parameter takes effect only if Status is set to ConsoleProtection.
| |
Status | string | No | Specifies whether to enable the configuration read-only mode. Valid values:
Note
If you set this parameter to ConsoleProtection, you cannot use the ALB console to modify instance configurations. However, you can call API operations to modify instance configurations.
| ConsoleProtection |
ZoneMappings | object [] | Yes | The zones and the vSwitches in the zones. You must specify at least two zones. | |
VSwitchId | string | Yes | The vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone of an ALB instance. You can specify up to 10 zones. | vsw-sersdf**** |
ZoneId | string | Yes | The zone ID of the ALB instance. You can specify up to 10 zones for an ALB instance. You can call the DescribeZones operation to query the most recent zone list. | cn-hangzhou-a |
IntranetAddress | string | No | The private IPv4 address. You must add at least two zones. You can add a maximum of 10 zones. | 192.168.10.1 |
AddressAllocatedMode | string | No | The mode used to assign IP addresses to zones of the ALB instance. Default value: Dynamic. Valid values:
| Dynamic |
ResourceGroupId | string | No | The ID of the resource group. | rg-atstuj3rtop**** |
LoadBalancerEdition | string | Yes | The edition of the ALB instance. The features and billing rules vary based on the edition of the ALB instance. Valid values:
| Standard |
LoadBalancerBillingConfig | object | Yes | The configuration of the billing method of the ALB instance. | |
PayType | string | Yes | The billing method of the ALB instance. Set the value to PostPay, which specifies the pay-as-you-go billing method. | PostPay |
BandwidthPackageId | string | No | The ID of the Elastic IP Address (EIP) bandwidth plan that is associated with the ALB instance if the ALB instance uses a public IP address. | cbwp-bp1vevu8h3ieh**** |
AddressIpVersion | string | No | The protocol version. Valid values:
| IPv4 |
Tag | object [] | No | The tags. | |
Key | string | No | The tag key can be up to 128 characters in length, and cannot start with acs: or aliyun. It cannot contain http:// or https://. | env |
Value | string | No | The tag value can be up to 128 characters in length, and cannot start with acs: or aliyun. It cannot contain http:// or https://. | product |
Response parameters
Examples
Sample success responses
JSON
format
{
"LoadBalancerId": "alb-o9ulmq5hgn68jk****",
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ResourceNotEnough.VSwitchIp | The specified resource %s is not enough. | The specified resource %s is not enough. |
400 | QuotaExceeded.LoadBalancersNum | The quota of %s is exceeded, usage %s/%s. | The quota of %s is exceeded, usage %s/%s. |
400 | Mismatch.ZoneIdAndVSwitchId | The %s and %s are mismatched. | The %s and %s are mismatched. |
400 | DuplicatedParam.ZoneId | The param of ZoneId is duplicated. | - |
404 | ResourceNotFound.VSwitch | The specified resource %s is not found. | The specified resource %s is not found. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||
---|---|---|---|---|---|---|---|---|
2024-01-18 | The Error code has changed | see changesets | ||||||
| ||||||||
2023-11-03 | The Error code has changed | see changesets | ||||||
| ||||||||
2023-10-30 | The Error code has changed | see changesets | ||||||
|