Creates an HTTPS listener.
Operation description
A newly created listener is in the stopped state. After a listener is created, you can call the StartLoadBalancerListener operation to start the listener. After the listener is started, the listener can forward traffic to backend servers.
Prerequisites
A Classic Load Balancer (CLB) instance is created. For more information, see CreateLoadBalancer .
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 |
---|---|---|---|---|
slb:CreateLoadBalancerHTTPSListener | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | No | The region ID of the CLB instance. You can query the region ID from the Regions and zones list or by calling the DescribeRegions operation. | cn-hangzhou |
LoadBalancerId | string | Yes | The ID of the CLB instance. | lb-bp1o94dp5i6earr**** |
Bandwidth | integer | Yes | The maximum bandwidth of the listener. Unit: Mbit/s. The URL must meet the following requirements:
| -1 |
ListenerPort | integer | Yes | The frontend port that is used by the CLB instance. Valid values: 1 to 65535. | 80 |
BackendServerPort | integer | No | The backend port that is used by the CLB instance. Valid values: 1 to 65535. If the VServerGroupId parameter is not set, this parameter is required. | 80 |
Tag | array<object> | No | The tags. | |
object | No | The tags. | ||
Key | string | No | The tag key of the resource. 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 | TestKey |
Value | string | No | The tag value of the resource. You can specify up to 20 tag values. The tag value cannot be an empty string. The tag value can be up to 128 characters in length and cannot start with | TestValue |
XForwardedFor | string | No | Specifies whether to use the
| on |
Scheduler | string | No | The scheduling algorithm. Valid values:
| wrr |
StickySession | string | Yes | Specifies whether to enable session persistence. Valid values:
| on |
StickySessionType | string | No | The method that is used to handle a cookie. Valid values: insert and server.
Note
This parameter is required if the StickySession parameter is set to on.
| insert |
CookieTimeout | integer | No | The timeout period of a cookie. Unit: seconds. Valid values: 1 to 86400. Note
If StickySession is set to on and StickySessionType is set to insert, this parameter is required.
| 500 |
Cookie | string | No | The cookie that you configure for the server. The cookie must be 1 to 200 characters in length, and can contain only ASCII letters and digits. It cannot contain commas (,), semicolons (;), spaces, or start with a dollar sign ($). Note
This parameter is required when the StickySession parameter is set to on and the StickySessionType parameter is set to server.
| B490B5EBF6F3CD402E515D22BCDA**** |
HealthCheck | string | Yes | Specifies whether to enable the health check feature. Valid values:
| on |
HealthCheckMethod | string | No | The health check method used in HTTP health checks. Valid values: head and get. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| get |
HealthCheckDomain | string | No | The domain name that is used for health checks. Valid values:
Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| 172.XX.XX.16 |
HealthCheckURI | string | No | The URI that is used for health checks. The URI must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| /test/index.html |
HealthyThreshold | integer | No | 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. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| 4 |
UnhealthyThreshold | integer | No | 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. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| 4 |
HealthCheckTimeout | integer | No | The timeout period of a health check response. If a backend ECS instance does not respond within the specified timeout period, the ECS instance fails the health check. Unit: seconds Valid values: 1 to 300. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| 3 |
HealthCheckConnectPort | integer | No | The port that is used for health checks. Valid values: 1 to 65535. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| 8080 |
HealthCheckInterval | integer | No | The interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| 5 |
HealthCheckHttpCode | string | No | The HTTP status code for a successful health check. Separate multiple HTTP status codes with commas (,). Valid values: http_2xx, http_3xx, http_4xx, and http_5xx. Note
This parameter takes effect only if the HealthCheck parameter is set to on.
| http_2xx,http_3xx |
ServerCertificateId | string | Yes | The ID of the server certificate. | idkp-123-cn-test-**** |
VServerGroupId | string | No | The ID of the server group. | rsp-cige6j5e7p**** |
CACertificateId | string | No | The ID of the certification authority (CA) certificate. If both the CA certificate and the server certificate are uploaded, mutual authentication is used. If you upload only the server certificate, one-way authentication is used. | 139a00604ad-cn-east-hangzh**** |
XForwardedFor_SLBIP | string | No | Specifies whether to use the
| on |
XForwardedFor_SLBID | string | No | Specifies whether to use the
| on |
XForwardedFor_proto | string | No | Specifies whether to use the
| on |
Gzip | string | No | Specifies whether to enable
| on |
AclId | string | No | The ID of the network access control list (ACL) that is associated with the listener. Note
This parameter is required if AclStatus is set to on.
| nacl-a2do9e413e0spzasx**** |
AclType | string | No | The type of the network ACL. Valid values:
Note
If AclStatus is set to on, this parameter is required.
| white |
AclStatus | string | No | Specifies whether to enable access control. Valid values:
| off |
Description | string | No | 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 (_). | HTTPS_443 |
IdleTimeout | integer | No | The timeout period of an idle connection. Valid values: 1 to 60. Default value: 15. Unit: seconds. If no request is received within the specified timeout period, CLB closes the connection. When a request is received, CLB establishes a new connection. | 12 |
RequestTimeout | integer | No | The timeout period of a request. Valid values: 1 to 180. Default value: 60. Unit: seconds. If no response is received from a backend server within the specified timeout period, CLB returns the HTTP 504 status code to the client. | 23 |
EnableHttp2 | string | No | Specifies whether to enable HTTP/2. Valid values:
| off |
TLSCipherPolicy | string | No | The Transport Layer Security (TLS) security policy. Each security policy contains TLS protocol versions and cipher suites available for HTTPS.
| tls_cipher_policy_1_1 |
XForwardedFor_SLBPORT | string | No | Specifies whether to use the
| off |
XForwardedFor_ClientSrcPort | string | No | Specifies whether to use the
| off |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertSubjectDNAlias is duplicate. Please change to a different one. | - |
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertIssuerDNAlias is duplicate. Please change to a different one. | - |
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertFingerprintAlias is duplicate. Please change to a different one. | - |
400 | ParamDuplicateError | The specified parameter value of XForwardedFor_ClientCertClientVerifyAlias is duplicate. Please change to a different one. | - |
400 | IpVersionConflict | The ip version of this LoadBalancer and the Acl is conflict. | - |
400 | InvalidParameter.IdleTimeout | The specified IdleTimeout exceeds the limit. | - |
400 | InvalidParameter.RequestTimeout | The specified RequestTimeout exceeds the limit. | - |
400 | ListenerForwardNotSupport | X-Forward-For is not supported to a ipv6 instance. | - |
400 | InvalidParameter.RegionNotSupport | The region does not support the parameter: %s. | - |
400 | InvalidParameter.SpecNotSupport | The loadBalancer of shared spec does not support the parameter: %s. | - |
400 | ListenerProcessing | A previous configuration of the listener is pending,please try again later. | - |
400 | Certkey.Forbidden | The specified certkey is not owned by the current user. | - |
400 | InvalidParameter.ListenerPortConflict | There is conflict listener port exists. | - |
400 | ResourceNotAvailible.HttpsListener | The specified Zone did not have enough resource. | - |
400 | AclNotExist | Acl does not exist. | - |
400 | OperationUnsupported.CreateLoadBalancerLayer7Listener | The slb instance does not support create HTTP or HTTPS listener. | - |
400 | InvalidParameter.VServerGroupId | The MasterSlaveServerGroup can not be attached to HTTP or HTTPS listener. | - |
400 | MissingParam.HealthCheckDomain | The HealthCheckDomain is required when HealthCheckHttpVersion is http1.1. | - |
400 | InvalidParameter.HealthCheckHttpVersion | The param HealthCheckHttpVersion is invalid. | - |
400 | QuotaLimitExceeds.AclAttachedToListener | %s. | - |
400 | QuotaLimitExceeds.TotalAclEntry | %s. | - |
400 | AclListenerOverLimit | %s. | - |
400 | Duplicated.AclEntry | %s. | - |
400 | CertificateNotExist | The specified CertificateId does not exist. | - |
400 | OperationFailed.InsufficientResources | The loadbalancer does not support this operation because of insufficient resources. | - |
400 | InvalidTLSPolicyId.NotExist | The specified TLS cipher policy does not exist. | - |
400 | TLSPolicyConfiguring | The specified TLS cipher policy is configuring. | - |
400 | TLSCipherPolicyVipRelationOverLimit | The number of listeners associated with a policy has exceeded. | - |
400 | CertificateTypeMismatched | The certificate type does not match. | - |
400 | MissingParam.ServerCertificates | Server certificates are required. | - |
400 | TooManyCertificates | The number of certificates must not be greater than one. | - |
400 | CnCertificateNotSupport | The cn certificate is not support. | - |
400 | InvalidParam.CertificateBindingType | The param CertificateBindingType is invalid. | - |
400 | InvalidParamSize.ServerCertificates | The size of param ServerCertificates is invalid. | - |
400 | TooManyCertificates.ServerCertificates | The number of certificates must not be greater than one. | - |
400 | SPEC_NOT_SUPPORT_PARAMETER | Share spec does not support the feature. | - |
400 | LbNotSupportTcpssl | You cannot create a TCP SSL type listener for the specified load balancer. | - |
400 | LbSupportTcpsslOnly | The specified load balancer supports TCP SSL type listener only. | - |
400 | ListenerNotSupportRule | You cannot create a rule for the specified listener. | You cannot create a rule for the specified listener. |
400 | Mismatch.SlbSpecTypeAndListenerProtocol | The SlbSpecType and ListenerProtocol are mismatched. | - |
400 | InvalidParam.TagValue | %s. | - |
400 | InvalidParam.TagKey | %s. | - |
400 | SizeLimitExceeded.Tag | %s. | - |
400 | MissingParam.TagKey | The param MissingParam.TagKey is missing. | - |
404 | ResourceNotFound.Certificate | The specified resource is not found. | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-12-14 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-06-02 | The Error code has changed | View Change Details |