All Products
Search
Document Center

Server Load Balancer:UpdateListenerAttribute

Last Updated:Aug 12, 2026

Updates the configuration of a Network Load Balancer (NLB) listener.

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

nlb:UpdateListenerAttribute

update

*LoadBalancer

acs:nlb:{#regionId}:{#accountId}:loadbalancer/{#LoadBalancerId}

  • nlb:SecurityPolicyId
None

Request parameters

Parameter

Type

Required

Description

Example

ListenerId

string

Yes

The listener instance ID.

lsn-bp1bpn0kn908w4nbw****@443

ListenerDescription

string

No

The custom listener name.

The name must be 2 to 256 characters in length, and can contain Chinese characters, letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).

tcpssl_443

ServerGroupId

string

No

The server group ID.

Note
  • If the listener uses TCP, the listener supports server groups with a backend protocol of TCP or TCP_UDP, but does not support server groups with a backend protocol of UDP.

  • If the listener uses UDP, the listener supports server groups with a backend protocol of UDP or TCP_UDP, but does not support server groups with a backend protocol of TCP.

  • If the listener uses TCPSSL, the listener supports server groups with a backend protocol of TCP and client IP preservation disabled, but does not support server groups with a backend protocol of TCP and client IP preservation enabled, or server groups with a backend protocol of UDP or TCP_UDP.

sgp-ppdpc14gdm3x4o****

SecurityPolicyId

string

No

The security policy ID.

Note

This parameter takes effect only for TCPSSL listeners.

tls_cipher_policy_1_1

CertificateIds

array

No

The server certificate list. Only one server certificate can be added.

Note

This parameter takes effect only for TCPSSL listeners.

string

No

The server certificate list. Only one server certificate can be added.

Note

This parameter takes effect only for TCPSSL listeners.

123157******

CaCertificateIds

array

No

The CA certificate list. Only one CA certificate can be added.

Note

This parameter takes effect only for TCPSSL listeners.

string

No

The CA certificate list. Only one CA certificate can be added.

Note

This parameter takes effect only for TCPSSL listeners.

139a00******

CaEnabled

boolean

No

Specifies whether to enable mutual authentication. Valid values:

  • true: enabled.

  • false (default): disabled.

false

IdleTimeout

integer

No

The timeout period of idle connections. Unit: seconds.

  • If the listener uses TCP or TCPSSL, the valid values are 10 to 900. Default value: 900.

  • If the listener uses UDP, the valid values are 10 to 90. Default value: 90.

900

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without updating the listener. The system checks the required parameters, request syntax, and business restrictions. If the check fails, the corresponding error is returned. If the check succeeds, the error code DryRunOperation is returned.

  • false (default): performs a dry run and sends the request. If the check succeeds, an HTTP 2xx status code is returned and the operation is performed.

false

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 client token can contain only ASCII characters.

Note

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

123e4567-e89b-12d3-a456-426655440000

RegionId

string

No

The region ID of the Network Load Balancer (NLB) instance.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

ProxyProtocolEnabled

boolean

No

Specifies whether to use the Proxy Protocol to pass the client source address to the backend server. Valid values:

  • true: enabled.

  • false: disabled.

false

SecSensorEnabled

boolean

No

Specifies whether to enable fine-grained monitoring. Valid values:

  • true: enabled.

  • false: disabled.

false

AlpnEnabled

boolean

No

Specifies whether to enable Application-Layer Protocol Negotiation (ALPN). Valid values:

  • true: enabled.

  • false: disabled.

false

AlpnPolicy

string

No

The ALPN policy. Valid values:

  • HTTP1Only: negotiates only HTTP1.x. Priority: HTTP1.1 > HTTP1.0.

  • HTTP2Only: negotiates only HTTP2.0.

  • HTTP2Optional: preferentially uses HTTP1.x but also accepts HTTP2.0. Priority: HTTP1.1 > HTTP1.0 > HTTP2.0.

  • HTTP2Preferred: preferentially uses HTTP2.0 but also accepts HTTP1.x. Priority: HTTP2.0 > HTTP1.1 > HTTP1.0.

Note

This parameter is required when AlpnEnabled is set to true.

HTTP1Only

Cps

integer

No

The maximum number of new connections per second on each zone (VIP) of the listener. Valid values: 0 to 1000000. 0 indicates no limit.

10000

Mss

integer

No

The maximum segment size of TCP packets. Unit: bytes. Valid values: 0 to 1500. 0 indicates that the MSS value of user TCP packets is not modified. This parameter takes effect only for TCP and TCPSSL listeners.

344

ProxyProtocolV2Config

object

No

The configuration for passing VpcId, PrivateLinkEpId, and PrivateLinkEpsId information to the backend server through the Proxy Protocol.

Ppv2VpcIdEnabled

boolean

No

Specifies whether to use the Proxy Protocol to pass VpcId to the backend server. Valid values:

  • true: enabled.

  • false: disabled.

false

Ppv2PrivateLinkEpIdEnabled

boolean

No

Specifies whether to use the Proxy Protocol to pass PrivateLinkEpId to the backend server. Valid values:

  • true: enabled.

  • false: disabled.

false

Ppv2PrivateLinkEpsIdEnabled

boolean

No

Specifies whether to use the Proxy Protocol to pass PrivateLinkEpsId to the backend server. Valid values:

  • true: enabled.

  • false: disabled.

false

Response elements

Element

Type

Description

Example

object

The response for updating the listener configuration.

RequestId

string

The request ID.

CEF72CEB-54B6-4AE8-B225-F876FF7BA984

JobId

string

The asynchronous task ID.

72dcd26b-f12d-4c27-b3af-18f6aed5****

Examples

Success response

JSON format

{
  "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
  "JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Mismatch.VpcId The VpcId is mismatched for %s and %s. The VpcId is mismatched for %s and %s.
400 Conflict.Port The Port [%s] is conflict. The specified port conflicts with an existing port
400 ResourceNotFound.Certificate The specified resource %s is not found.
400 IncorrectStatus.listener The status of listener [%s] is incorrect. The current operation cannot be performed on the listener as its status is unavailable. Please check if the listener is currently undergoing any other operations.
400 IdempotenceSignatureMismatch The idempotence token of request is same with the prev one, but the signature is different. The requested idempotent token is the same as the previous one, but the signature is different.
400 DryRunOperation Request validation has been passed with DryRun flag set. Request validation has been passed with DryRun flag set.
400 ResourceAlreadyAssociated.Certificate The specified resource %s is already associated.
400 IllegalParamSize.certificateIds The param size of certificateIds or caCertificateIds is illegal. you can only have one certificate id. check whether the id is entered repeatedly.
400 SystemBusy System is busy, please try again later.
400 IllegalParam.IdleTimeout The param of IdleTimeout is illegal. The parameter connection idle timeout configuration is invalid.
400 OperationDenied.RegionNotSupportHDMonitor The operation is not allowed because of RegionNotSupportHDMonitor. The current region does not support second-level monitoring.
400 ResourceNotEnough.CaCertificateApiCount The specified resource of CaCertificateApiCount is not enough.
400 IllegalParam The param of %s is illegal.
403 Forbidden.NoPermission Authentication is failed for NoPermission. Authentication is failed for NoPermission.
404 ResourceNotFound.listener The specified resource %s is not found.
404 ResourceNotFound.HdMonitorConfigNotExist The specified resource of HdMonitorConfigNotExist is not found. HdMonitorConfig does not exist, check the input parameters.
404 ResourceNotFound.CaCertificate The specified resource of CaCertificate is not found. Ca certificate does not exist, please check the input parameters.
404 ResourceNotFound.securitypolicy The specified resource of securitypolicy is not found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.