All Products
Search
Document Center

Server Load Balancer:UpdateListenerAttribute

Last Updated:Sep 02, 2026

Updates the configuration of a listener, such as the name and default action.

Operation description

UpdateListenerAttribute is an asynchronous operation. After a request ID is returned, the listener configuration update is still being processed in the background. You can call GetListenerAttribute to query the update status of the listener configuration:

  • If the listener is in the Configuring state, the listener configuration is being updated.

  • If the listener is in the Running state, the listener configuration has been updated.

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:UpdateListenerAttribute

update

*LoadBalancer

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

*SecurityPolicy

acs:alb:{#regionId}:{#accountId}:securitypolicy/{#securitypolicyId}

*ServerGroup

acs:alb:{#regionId}:{#accountId}:servergroup/{#servergroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ListenerId

string

Yes

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

lsn-o4u54y73wq7b******

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note

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

5A2CFF0E-5718-45B5-9D4D-70B******

DryRun

boolean

No

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error code is returned. If the request passes the dry run, the DryRunOperation error code is returned.

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

false

ListenerDescription

string

No

The custom listener name.

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

HTTP_80

RequestTimeout

integer

No

The request timeout period. Unit: seconds. Valid values: 1 to 600.

If no response is received from the backend server within the timeout period, load balancing returns an HTTP 504 error code to the client.

60

IdleTimeout

integer

No

The idle connection timeout period. Unit: seconds. Valid values: 1 to 600.

If no access request is received within the timeout period, load balancing temporarily breaks the current connection and restores the connection when the next request arrives.

15

GzipEnabled

boolean

No

Specifies whether to enable Gzip compression to compress specific types of files. Valid values:

  • true: enabled.

  • false: disabled.

true

Http2Enabled

boolean

No

Specifies whether to enable HTTP/2. Valid values:

  • true: enabled.

  • false: disabled.

Note

Only HTTPS listeners support this parameter.

true

SecurityPolicyId

string

No

The security policy. System security policies and custom security policies are supported.

Note

Only HTTPS listeners support this parameter.

tls_cipher_policy_1_0

CaEnabled

boolean

No

Specifies whether to enable mutual authentication. Valid values:

  • true: enabled.

  • false: disabled.

false

XForwardedForConfig

object

No

The configuration of the XForwardedFor feature.

XForwardedForClientCertClientVerifyAlias

string

No

The custom header field name. This parameter takes effect only when XForwardedForClientCertClientVerifyEnabled is set to true.

The name must be 1 to 40 characters in length, and can contain lowercase letters a to z, hyphens (-), underscores (_), and digits.

Note

Only HTTPS listeners support this parameter.

test_client-verify-alias_123456

XForwardedForClientCertClientVerifyEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-clientverify header field to retrieve the verification result of the client certificate that accesses the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

Only HTTPS listeners support this parameter.

false

XForwardedForClientCertFingerprintAlias

string

No

The custom header field name. This parameter takes effect only when XForwardedForClientCertFingerprintEnabled is set to true.

The name must be 1 to 40 characters in length, and can contain lowercase letters a to z, hyphens (-), underscores (_), and digits.

Note

Only HTTPS listeners support this parameter.

test_finger-print-alias_123456

XForwardedForClientCertFingerprintEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-fingerprint header field to retrieve the fingerprint of the client certificate that accesses the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

Only HTTPS listeners support this parameter.

false

XForwardedForClientCertIssuerDNAlias

string

No

The custom header field name. This parameter takes effect only when XForwardedForClientCertIssuerDNEnabled is set to true.

The name must be 1 to 40 characters in length, and can contain lowercase letters a to z, hyphens (-), underscores (_), and digits.

Note

Only HTTPS listeners support this parameter.

test_issue-dn-alias_123456

XForwardedForClientCertIssuerDNEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-issuerdn header field to retrieve the issuer information of the client certificate that accesses the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

Only HTTPS listeners support this parameter.

false

XForwardedForClientCertSubjectDNAlias

string

No

The custom header field name. This parameter takes effect only when XForwardedForClientCertSubjectDNEnabled is set to true.

The name must be 1 to 40 characters in length, and can contain lowercase letters a to z, hyphens (-), underscores (_), and digits.

Note

Only HTTPS listeners support this parameter.

test_subject-dn-alias_123456

XForwardedForClientCertSubjectDNEnabled

boolean

No

Specifies whether to use the X-Forwarded-Clientcert-subjectdn header field to retrieve the owner information of the client certificate that accesses the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

Only HTTPS listeners support this parameter.

false

XForwardedForClientSrcPortEnabled

boolean

No

Specifies whether to use the X-Forwarded-Client-srcport header field to retrieve the port of the client that accesses the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

HTTP and HTTPS listeners support this parameter.

false

XForwardedForEnabled

boolean

No

Specifies whether to use the X-Forwarded-For header field to retrieve the real IP address of the client. Valid values:

  • true (default): enabled.

  • false: disabled.

Note
  1. If you set this parameter to true, XForwardedForProcessingMode defaults to append and can be changed to remove.

  2. If you set this parameter to false, the X-Forwarded-For header field is retained without additional processing before the request is sent to the backend server.

  3. HTTP and HTTPS listeners support this parameter.

true

XForwardedForProcessingMode

string

No

The processing mode for the X-Forwarded-For header field. This parameter takes effect only when XForwardedForEnabled is set to true. Valid values:

  • append (default): append.

  • remove: remove.

Note
  1. If you set this parameter to append, the last-hop IP address is appended to the X-Forwarded-For header field before the request is sent to the backend server.

  2. If you set this parameter to remove, the X-Forwarded-For header is removed before the request is sent to the backend server, regardless of whether the request contains the X-Forwarded-For header field.

  3. HTTP and HTTPS listeners support this parameter.

append

XForwardedForProtoEnabled

boolean

No

Specifies whether to use the X-Forwarded-Proto header field to retrieve the listener protocol of the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

false

XForwardedForSLBIdEnabled

boolean

No

Specifies whether to use the SLB-ID header field to retrieve the load balancing instance ID. Valid values:

  • true: enabled.

  • false: disabled.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

false

XForwardedForSLBPortEnabled

boolean

No

Specifies whether to use the X-Forwarded-Port header field to retrieve the listener port of the load balancing instance. Valid values:

  • true: enabled.

  • false: disabled.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

false

XForwardedForClientSourceIpsEnabled

boolean

No

Specifies whether to allow ALB to retrieve the real client IP address from the X-Forwarded-For header field. Valid values:

  • true: enabled.

  • false: disabled.

Note

HTTP and HTTPS listeners support this parameter.

false

XForwardedForClientSourceIpsTrusted

string

No

The trusted proxy IP addresses.

Application Load Balancing (ALB) traverses the X-Forwarded-For header field from right to left and selects the first IP address that is not in the trusted IP list as the real client IP address. This IP address is used for source IP-based rate limiting.

10.1.1.0/24

XForwardedForHostEnabled

boolean

No

Specifies whether to use the X-Forwarded-Host header field to retrieve the domain name of the client that accesses the load balancing instance. Valid values:

  • true: enabled.

  • false (default): disabled.

Note

HTTP, HTTPS, and QUIC listeners support this parameter.

false

QuicConfig

object

No

The configuration information when an associated QUIC listener is enabled.

QuicListenerId

string

No

The ID of the QUIC listener to be associated. This parameter is required when QuicUpgradeEnabled is set to true. This parameter is valid only for HTTPS listeners.

Note

The original listener and the associated QUIC listener must belong to the same ALB instance, and the QUIC listener must not have been previously associated.

lsn-333

QuicUpgradeEnabled

boolean

No

Specifies whether to enable QUIC upgrade. Valid values:

  • true: enabled.

  • false: disabled.

Note

This parameter is valid only for HTTPS listeners.

false

Certificates

array<object>

No

The certificate list.

object

No

The certificate structure.

CertificateId

string

No

The default certificate ID. Only one default server certificate is supported.

Note
  • This parameter is required when the listener protocol type is HTTPS or QUIC.

  • To add more server certificates, invoke AssociateAdditionalCertificatesWithListener to configure extension certificates after the listener is created.

123157******

CaCertificates

array<object>

No

The CA certificate list. Only one CA certificate is supported.

object

No

The CA certificate structure.

CertificateId

string

No

The CA certificate ID.

Note

This parameter is required when CaEnabled is set to true.

123359******

DefaultActions

array<object>

No

The list of default rule actions.

array<object>

No

The default rule action structure.

ForwardGroupConfig

object

No

The forwarding configuration for the action. This parameter is required and valid only when Type is set to ForwardGroup. You can add up to 20 forwarding action configurations.

ServerGroupTuples

array<object>

Yes

The list of forwarding destination server group tuples.

object

No

The forwarding destination server group tuple structure.

ServerGroupId

string

Yes

The ID of the destination server group to which requests are forwarded.

sgp-i5qt20******

Type

string

Yes

The action type. You can add up to one action type.

Valid values: ForwardGroup, which indicates that requests are forwarded to multiple server groups.

ForwardGroup

Response elements

Element

Type

Description

Example

object

The response struct.

JobId

string

The asynchronous task ID.

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

RequestId

string

The request ID.

365F4154-92F6-4AE4-92F8-7FF******

Examples

Success response

JSON format

{
  "JobId": "72dcd26b-f12d-4c27-b3af-18f6aed5****",
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF******"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectStatus.LoadBalancer The status of %s [%s] is incorrect. The current status of the instance does not support this operation.
400 IncorrectBusinessStatus.LoadBalancer The business status of %s [%s]  is incorrect. The business status of %s [%s]  is incorrect.
400 IncorrectStatus.Listener The status of %s [%s] is incorrect. This operation is not supported in the listener's current state.
400 OperationDenied.CrossLoadBalancerQUICListener The operation is not allowed because of %s. The operation is not allowed because of %s.
400 ResourceAlreadyAssociated.Listener The specified resource %s is already associated. The specified resource %s is already associated.
400 OperationDenied.GRPCServerGroup The operation is not allowed because of %s. The operation is denied because a listener associated with this gRPC server group does not have HTTP/2.0 enabled.
400 ResourceAlreadyAssociated.Certificate The specified resource %s is already associated. The specified certificate is already associated.
400 ResourceQuotaExceeded.SecurityPolicyAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s. The quota of %s is exceeded for resource %s. Usage: %s/%s.
400 ResourceQuotaExceeded.ServerGroupAttachedNum The quota of %s is exceeded for resource %s, usage %s/%s. The number of associations for the server group has exceeded the quota limit.
400 ResourceQuotaExceeded.LoadBalancerServersNum The quota of %s is exceeded for resource %s, usage %s/%s. The number of backend servers has exceeded the quota limit.
400 ResourceQuotaExceeded.ServerAddedNum The quota of %s is exceeded for resource %s, usage %s/%s. The number of servers added to the server group has exceeded the quota limit.
400 OperationDenied.ServerGroupProtocolNotSupport The operation is not allowed because of ServerGroupProtocolNotSupport. The operation is not allowed because the server group protocol is not supported.
400 UnsupportedFeature.FullTraceHttps The feature of FullTraceHttps is not supported for current instance. The current instance edition does not support the end-to-end HTTPS feature.
400 ResourceInConfiguring.Listener The specified resource of %s is being configured, please try again later. The specified resource of %s is being configured, please try again later.
400 Mismatch.VpcId The %s is mismatched for %s and %s. The %s is mismatched for %s and %s.
400 InvalidParameter Invalid parameter, please check the parameter input. At least one parameter is invalid. Check your input.
400 OperationDenied.CACertificateCorrupted The CA certificate is corrupted. CA certificate is corrupted
403 Forbidden.LoadBalancer Authentication is failed for %s. Authentication is failed for %s.
404 ResourceNotFound.Listener The specified resource %s is not found. The listener does not exist.
404 ResourceNotFound.ServerGroup The specified resource %s is not found. The backend server group does not exist.
404 ResourceNotFound.SecurityPolicy The specified resource %s is not found. The specified resource %s is not found.
404 ResourceNotFound.Certificate 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.