All Products
Search
Document Center

Server Load Balancer:CreateLoadBalancer

Last Updated:Oct 26, 2026

Creates an Application Load Balancing (ALB) instance in a specified region.

Operation description

The CreateLoadBalancer operation is asynchronous. The system returns an instance ID, but the Application Load Balancing (ALB) instance is not yet created and the creation task is still running in the background. You can invoke the GetLoadBalancerAttribute operation to query the creation status of the Application Load Balancing (ALB) instance:

  • When the Application Load Balancing (ALB) instance is in the Provisioning state, the instance is being created.

  • When the Application Load Balancing (ALB) instance is in the Active state, the instance is created.

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

alb:CreateLoadBalancer

create

*LoadBalancer

acs:alb:{#regionId}:{#accountId}:loadbalancer/*

  • alb:AddressType
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 generate a parameter value from your client to ensure that the value is unique among different requests. The ClientToken parameter supports only ASCII characters.

Note

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

5A2CFF0E-5718-45B5-9D4D-70B3FF3898

DryRun

boolean

No

Specifies whether to perform only a dry run on the request. Valid values:

  • true: performs a dry run without creating the Application Load Balancing (ALB) instance. The system checks whether required parameters are specified, the request format, 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 sends a normal request. If the request passes the dry run, an HTTP 2xx status code is returned and the operation is performed.

false

VpcId

string

Yes

The ID of the virtual private cloud (VPC) where the Application Load Balancing (ALB) instance is deployed.

vpc-bp1b49rqrybk45nio****

AddressType

string

Yes

The network type of the Application Load Balancing (ALB) instance. Valid values:

  • Internet: The Application Load Balancing (ALB) instance uses a public IP address. The DNS domain name is parsed to the public IP address. Therefore, the instance can be accessed in the Internet environment.

  • Intranet: The Application Load Balancing (ALB) instance uses only a private IP address. The DNS domain name is parsed to the private IP address. Therefore, the instance can be accessed only in the internal network environment of the VPC where the Application Load Balancing (ALB) instance is deployed.

Internet

LoadBalancerName

string

No

The name of the Application Load Balancing (ALB) instance.

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

alb1

DeletionProtectionEnabled

boolean

No

Specifies whether to enable deletion protection. Valid values:

  • true: enables deletion protection.

  • false (default): disables deletion protection.

false

ModificationProtectionConfig

object

No

The modification protection configuration.

Reason

string

No

The reason for enabling modification protection.

The value must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter or a Chinese character.

Note

This parameter is valid only when Status is set to ConsoleProtection.

Managed Instance

Status

string

No

The modification protection status of the Application Load Balancing (ALB) instance. Valid values:

  • NonProtection: disables modification protection. If Reason is specified, it is forcibly cleared.

  • ConsoleProtection: enables modification protection in the console. If Reason is specified, it takes effect.

Note

When this parameter is set to ConsoleProtection, users cannot modify the instance configurations in the load balancing console, but can invoke API operations to modify the instance configurations.

ConsoleProtection

ZoneMappings

array<object>

Yes

The list of zone and vSwitch mappings. You can specify up to 10 zones. If the current region supports two or more zones, you must specify at least two zones.

object

No

The list of zone and vSwitch mappings. You can add up to 10 zones. If the current region supports two or more zones, you must add at least two zones.

VSwitchId

string

Yes

The ID of the vSwitch in the zone. You can use only one vSwitch and one subnet in each zone. You can add up to 10 zones. If the current region supports two or more zones, you must add at least two zones.

vsw-sersdf****

ZoneId

string

Yes

The zone ID. You can add up to 10 zones. If the current region supports two or more zones, you must add at least two zones. You can call the DescribeZones operation to query the information about the zones.

cn-hangzhou-a

AllocationId

string

No

The instance ID of the elastic IP address (EIP) that is attached to the Internet-facing instance.

eip-bp1aedxso6u80u0qf****

EipType

string

No

The type of the EIP. Valid values:

  • Common (default): EIP.

  • Anycast: Anycast EIP.

Note

For more information about the regions where ALB supports Anycast EIPs, see Limits.

Common

IntranetAddress

string

No

The IPv4 private IP address.

192.168.10.1

AddressAllocatedMode

string

No

The IP address allocation mode. Valid values:

  • Fixed (default): fixed IP mode. A fixed IP address is allocated to each zone.

  • Dynamic: dynamic IP mode. IP addresses are dynamically allocated to each zone.

Note

Starting from 00:00:00 on February 25, 2025 (UTC+8), when you create an instance by calling this operation, an upgraded ALB instance is created regardless of the mode you specify. The IP address allocation mode is no longer distinguished, and the allocated IP addresses are automatically scalable. Existing ALB instances created before the upgrade are not affected.

Fixed

ResourceGroupId

string

No

The ID of the resource group.

rg-atstuj3rtop****

LoadBalancerEdition

string

Yes

The edition of the Application Load Balancing (ALB) instance. Different editions have different feature limits and billing policy. Valid values:

  • Basic: Basic Edition.

  • Standard: Standard Edition.

  • StandardWithWaf: WAF-enhanced Edition.

Standard

LoadBalancerBillingConfig

object

Yes

The billing configuration of the Application Load Balancing (ALB) instance.

PayType

string

Yes

The billing method of the instance.

Set the value to PostPay, which specifies the pay-as-you-go billing method.

PostPay

BandwidthPackageId

string

No

The ID of the Internet Shared Bandwidth instance that is associated with the Internet-facing ALB instance.

cbwp-bp1vevu8h3ieh****

AddressIpVersion

string

No

The IP version. Valid values:

  • IPv4: IPv4.

  • DualStack: dual-stack.

IPv4

Tag

array<object>

No

The tags.

object

No

The tag structure.

Key

string

No

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

env

Value

string

No

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

product

SecurityGroupIds

array<object>

No

The IDs of the security groups.

object

No

The IDs of the security groups.

SecurityGroupId

string

No

The ID of the security group.

sg-gw82chzr7ru23iwbn9mu

Response elements

Element

Type

Description

Example

object

The response for creating a load balancing instance.

LoadBalancerId

string

The instance ID of the Application Load Balancing (ALB) instance.

alb-o9ulmq5hqn68jk****

RequestId

string

The request ID.

CEF72CEB-54B6-4AE8-B225-F876FF7BA984

Examples

Success response

JSON format

{
  "LoadBalancerId": "alb-o9ulmq5hqn68jk****",
  "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. The parameter ZoneId is duplicate.
400 OperationDenyed.ServiceLinkedRoleNotExist The service linked role AliyunServiceRoleForAlb does not exist. The user account is not associated with the Alibaba Cloud service-linked role AliyunServiceRoleForAlb.
404 ResourceNotFound.VSwitch The specified resource %s is not found. The specified resource %s is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.