All Products
Search
Document Center

Server Load Balancer:CreateLoadBalancerUDPListener

Last Updated:Sep 20, 2024

Creates a UDP listener.

Operation description

UDP listeners of Classic Load Balancer (CLB) instances in a classic network cannot pass client IP addresses to backend servers.

Note A newly created listener is in the stopped state. After a listener is created, you can call the StartLoadBalancerListener operation to enable the listener to forward traffic to backend servers.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
slb:CreateLoadBalancerUDPListenercreate
  • acl
    acs:slb:{#regionId}:{#accountId}:acl/{#aclId}
  • loadbalancer
    acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}
  • slb:tag
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The ID of the region where the CLB instance is deployed.

cn-hangzhou
Tagarray<object>No

The tags.

objectNo

The tags.

KeystringNo

The key of the tag. You can specify up to 20 tag keys. The tag key cannot be an empty string.

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

TestKey
ValuestringNo

The tag value. Valid values of N: 1 to 20. The tag value can be an empty string.

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

TestValue
LoadBalancerIdstringYes

The ID of the CLB instance.

lb-bp1ygod3yctvg1y7****
ListenerPortintegerYes

The frontend port used by the CLB instance.

Valid values: 1 to 65535.

80
BackendServerPortintegerNo

The backend port used by the CLB instance.

Valid values: 1 to 65535.

If the VServerGroupId parameter is not set, this parameter is required.

80
BandwidthintegerYes

The maximum bandwidth of the listener. Unit: Mbit/s. Valid values:

-1: For a pay-by-data-transfer Internet-facing CLB instance, you can set this parameter to -1. This way, the bandwidth of the listener is unlimited.

-1
SchedulerstringNo

The routing algorithm. Valid values:

  • wrr (default): Backend servers with higher weights receive more requests than backend servers with lower weights.
  • rr: Requests are distributed to backend servers in sequence.
  • sch: specifies consistent hashing that is based on source IP addresses. Requests from the same source IP address are distributed to the same backend server.
  • tch: specifies consistent hashing that is based on four factors: source IP address, destination IP address, source port, and destination port. Requests that contain the same information based on the four factors are distributed to the same backend server.
  • qch: specifies consistent hashing that is based on QUIC connection IDs. Requests that contain the same QUIC connection ID are distributed to the same backend server.

Only high-performance CLB instances support the sch, tch, and qch consistent hashing algorithms.

wrr
HealthyThresholdintegerNo

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from fail to success.

Valid values: 2 to 10.

4
UnhealthyThresholdintegerNo

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from success to fail.

Valid values: 2 to 10.

4
HealthCheckConnectTimeoutintegerNo

The timeout period of a health check.

If a backend server, such as an Elastic Compute Service (ECS) instance, does not respond to a probe packet within the specified timeout period, the server fails the health check. Unit: seconds.

Valid values: 1 to 300.

100
HealthCheckConnectPortintegerNo

The port that is used for health checks.

Valid values: 1 to 65535.

If this parameter is not set, the backend port specified by BackendServerPort is used for health checks.

80
healthCheckIntervalintegerNo

The interval between two consecutive health checks. Unit: seconds.

Valid values: 1 to 50.

3
healthCheckReqstringNo

The request string for UDP listener health checks. The string must be 1 to 64 characters in length and can contain only letters and digits.

hello
healthCheckExpstringNo

The response string for UDP listener health checks. The string must be 1 to 64 characters in length and can contain only letters and digits.

ok
VServerGroupIdstringNo

The ID of the vServer group.

rsp-cige6j8****
MasterSlaveServerGroupIdstringNo

The ID of the primary/secondary server group.

Note You can set only one of the VServerGroupId and MasterSlaveServerGroupId parameters.
rsp-0bfucwu****
AclIdstringNo

The ID of the network ACL that is associated with the listener.

If AclStatus is set to on, this parameter is required.

123
AclTypestringNo

The type of the network ACL. Valid values:

  • white: a whitelist. Only requests from the IP addresses or CIDR blocks in the network ACL are forwarded. Whitelists apply to scenarios in which you want to allow only specific IP addresses to access an application. After a whitelist is configured, only IP addresses in the whitelist can access the CLB listener. Risks may arise if the whitelist is improperly set.

    If a whitelist is configured but no IP address is added to the whitelist, the listener forwards all requests.

  • black: a blacklist. All requests from the IP addresses or CIDR blocks in the network ACL are blocked. Blacklists apply to scenarios in which you want to deny access from specific IP addresses to an application.

    If a blacklist is configured for a listener but no IP address is added to the blacklist, the listener forwards all requests.

If AclStatus is set to on, this parameter is required.

white
AclStatusstringNo

Specifies whether to enable access control. Valid values:

  • on: yes
  • off (default): no
off
DescriptionstringNo

The name of the listener.

The name must be 1 to 256 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_).

udp_80
ProxyProtocolV2EnabledbooleanNo

Specifies whether to use the Proxy protocol to pass client IP addresses to backend servers. Valid values:

  • true: yes
  • false (default): no
false
HealthCheckSwitchstringNo

Specifies whether to enable the health check feature. Valid values:

  • on (default): yes
  • off: no
on

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

06F00FBB-3D9E-4CCE-9D43-1A6946A75556

Examples

Sample success responses

JSONformat

{
  "RequestId": "06F00FBB-3D9E-4CCE-9D43-1A6946A75556"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterValue.SpecNotSupportThe loadBalancer of shared spec does not support the parameter value, %s.-
400OperationNotSupport.AclThe cloud box instance does not support acl.-
400InvalidParameterValue.RegionNotSupportThe region does not support the parameter value, %s.-
400Abs.VServerGroupIdAndMasterSlaveServerGroupId.MissMatchThe parameters VServerGroupId or MasterSlaveServerGroupId miss match.-
400IpVersionConflictThe ip version of this LoadBalancer and the Acl is conflict.-
400InvalidParameterValue.ZoneNotSupportThe zone does not support the parameter value, %s.-
400ListenerProcessingA previous configuration of the listener is pending,please try again later.-
400AclNotExistAcl does not exist.-
400InvalidParameter.ListenerPortConflictThere is conflict listener port exists.-
400InvalidParam.VServerGroupIdThe specified VServerGroupId is invalid.-
400MissingParam.HealthCheckConnectPortThe parameter HealthCheckConnectPort is required.-
400InvalidParam.ListenerPortThe specified ListenerPort is invalid.-
400InvalidParam.StartPortThe specified StartPort is invalid.-
400InvalidParamSize.PortRangeThe size of param PortRange is invalid.-
400InvalidParam.EndPortThe specified EndPort is invalid.-
400QuotaLimitExceeds.AclAttachedToListener%s.-
400QuotaLimitExceeds.TotalAclEntry%s.-
400AclListenerOverLimit%s.-
400Duplicated.AclEntry%s.-
400InvalidParameter.RegionNotSupportThe region does not support the parameter: %s.-
400LbNotSupportTcpsslYou cannot create a TCP SSL type listener for the specified load balancer.-
400LbSupportTcpsslOnlyThe specified load balancer supports TCP SSL type listener only.-
400ListenerNotSupportRuleYou cannot create a rule for the specified listener.You cannot create a rule for the specified listener.
400InvalidParamLength.HealthCheckExpThe length of the parameter HealthCheckReq is invalid.-
400InvalidParamLength.HealthCheckReqThe length of the parameter HealthCheckReq is invalid.-
400InvalidParam.HealthCheckReqThe param HealthCheckReq is invalid.-
400InvalidParam.HealthCheckExpThe param HealthCheckExp is invalid.-
400ResourceNotFound.VServerGroup%s.-
400IllegalParam.FailoverThresholdThe parameter FailoverThreshold is illegal.-
400IllegalParam.FailoverStrategyThe parameter FailoverStrategy is illegal.-
400InvalidParameter.ZoneNotSupportThe zone does not support the parameter %s.-
400MasterSlaveServerConflictThe servers are conflict for MasterSlaveGroup.-
400VipNotSupportQuicVersionThe listener does not support the parameter of QuicVersion.-
400IllegalParam.HealthCheckTypeThe param of HealthCheckType is illegal.-
400MissingParam.HealthCheckMethodThe param of HealthCheckMethod is missing.-
400IllegalParam.HealthCheckMethodThe param of HealthCheckMethod is illegal.-
400IllegalParam.HealthCheckThe param of HealthCheck is illegal.-
400OperationDenied.SpecialListenerPortNotAllowedThe operation is not allowed because port 4789 is reserved by the system.-
400Mismatch.SlbSpecTypeAndListenerProtocolThe SlbSpecType and ListenerProtocol are mismatched.-
400OperationDenied.OnlyIpv4SlbSupportThe operation is not allowed because of OnlyIpv4SlbSupport.-
400OperationDenied.FullNatModeNotAllowedThe operation is not allowed because of FullNatModeNotAllowed.-
400SpecNotSupportParameterThe instance with share spec does not support FullNatEnabled parameter.-
400InvalidParam.TagValue %s.-
400InvalidParam.TagKey%s.-
400SizeLimitExceeded.Tag%s.-
400MissingParam.TagKeyThe param MissingParam.TagKey is missing.-

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

Change history

Change timeSummary of changesOperation
2023-06-02The Error code has changedView Change Details