Listener
Provides an Application Load Balancer Listener resource.
For information about slb and how to use it, see What is Server Load Balancer.
For information about listener and how to use it, to see the following:
- Configure a HTTP Listener.
- Configure a HTTPS Listener.
- Configure a TCP Listener.
Listener fields and protocol mapping
load balance support 4 protocal to listen on, they are http,https,tcp,udp, the every listener support which portocal following:
| listener parameter | support protocol | value range |
|---|---|---|
| backend_port | http & https & tcp & udp | 1-65535 |
| frontend_port | http & https & tcp & udp | 1-65535 |
| protocol | http & https & tcp & udp | |
| bandwidth | http & https & tcp & udp | -1 / 1-1000 |
| scheduler | http & https & tcp & udp | wrr rr or wlc |
| sticky_session | http & https | on or off |
| sticky_session_type | http & https | insert or server |
| cookie_timeout | http & https | 1-86400 |
| cookie | http & https | |
| persistence_timeout | tcp & udp | 0-3600 |
| health_check | http & https | on or off |
| health_check_type | tcp | tcp or http |
| health_check_domain | http & https & tcp | |
| health_check_method | http & https & tcp | |
| health_check_uri | http & https & tcp | |
| health_check_connect_port | http & https & tcp & udp | 1-65535 or -520 |
| healthy_threshold | http & https & tcp & udp | 1-10 |
| unhealthy_threshold | http & https & tcp & udp | 1-10 |
| health_check_timeout | http & https & tcp & udp | 1-300 |
| health_check_interval | http & https & tcp & udp | 1-50 |
| health_check_http_code | http & https & tcp | http_2xx,http_3xx,http_4xx,http_5xx |
| server_certificate_id | https | |
| gzip | http & https | true or false |
| x_forwarded_for | http & https | |
| acl_status | http & https & tcp & udp | on or off |
| acl_type | http & https & tcp & udp | white or black |
| acl_id | http & https & tcp & udp | the id of resource alicloud_slb_acl |
| established_timeout | tcp | 10-900 |
| idle_timeout | http & https | 1-60 |
| request_timeout | http & https | 1-180 |
| enable_http2 | https | on or off |
| tls_cipher_policy | https | tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict |
| server_group_id | http & https & tcp & udp | the id of resource alicloud.slb.ServerGroup |
The listener mapping supports the following:
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var name = config.Get("name") ?? "testcreatehttplistener";
var ipVersion = config.Get("ipVersion") ?? "ipv4";
var defaultLoadBalancer = new AliCloud.Slb.LoadBalancer("defaultLoadBalancer", new AliCloud.Slb.LoadBalancerArgs
{
Internet = true,
InternetChargeType = "PayByTraffic",
});
var defaultAcl = new AliCloud.Slb.Acl("defaultAcl", new AliCloud.Slb.AclArgs
{
EntryLists =
{
new AliCloud.Slb.Inputs.AclEntryListArgs
{
Comment = "first",
Entry = "10.10.10.0/24",
},
new AliCloud.Slb.Inputs.AclEntryListArgs
{
Comment = "second",
Entry = "168.10.10.0/24",
},
},
IpVersion = ipVersion,
});
var defaultListener = new AliCloud.Slb.Listener("defaultListener", new AliCloud.Slb.ListenerArgs
{
AclId = defaultAcl.Id,
AclStatus = "on",
AclType = "white",
BackendPort = 80,
Bandwidth = 10,
Cookie = "testslblistenercookie",
CookieTimeout = 86400,
FrontendPort = 80,
HealthCheck = "on",
HealthCheckConnectPort = 20,
HealthCheckDomain = "ali.com",
HealthCheckHttpCode = "http_2xx,http_3xx",
HealthCheckInterval = 5,
HealthCheckTimeout = 8,
HealthCheckUri = "/cons",
HealthyThreshold = 8,
IdleTimeout = 30,
LoadBalancerId = defaultLoadBalancer.Id,
Protocol = "http",
RequestTimeout = 80,
StickySession = "on",
StickySessionType = "insert",
UnhealthyThreshold = 8,
XForwardedFor = new AliCloud.Slb.Inputs.ListenerXForwardedForArgs
{
RetriveSlbId = true,
RetriveSlbIp = true,
},
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "testcreatehttplistener"
ip_version = config.get("ipVersion")
if ip_version is None:
ip_version = "ipv4"
default_load_balancer = alicloud.slb.LoadBalancer("defaultLoadBalancer",
internet=True,
internet_charge_type="PayByTraffic")
default_acl = alicloud.slb.Acl("defaultAcl",
entry_lists=[
{
"comment": "first",
"entry": "10.10.10.0/24",
},
{
"comment": "second",
"entry": "168.10.10.0/24",
},
],
ip_version=ip_version)
default_listener = alicloud.slb.Listener("defaultListener",
acl_id=default_acl.id,
acl_status="on",
acl_type="white",
backend_port=80,
bandwidth=10,
cookie="testslblistenercookie",
cookie_timeout=86400,
frontend_port=80,
health_check="on",
health_check_connect_port=20,
health_check_domain="ali.com",
health_check_http_code="http_2xx,http_3xx",
health_check_interval=5,
health_check_timeout=8,
health_check_uri="/cons",
healthy_threshold=8,
idle_timeout=30,
load_balancer_id=default_load_balancer.id,
protocol="http",
request_timeout=80,
sticky_session="on",
sticky_session_type="insert",
unhealthy_threshold=8,
x_forwarded_for={
"retriveSlbId": True,
"retriveSlbIp": True,
})import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "testcreatehttplistener";
const ipVersion = config.get("ipVersion") || "ipv4";
const defaultLoadBalancer = new alicloud.slb.LoadBalancer("default", {
internet: true,
internetChargeType: "PayByTraffic",
});
const defaultAcl = new alicloud.slb.Acl("default", {
entryLists: [
{
comment: "first",
entry: "10.10.10.0/24",
},
{
comment: "second",
entry: "168.10.10.0/24",
},
],
ipVersion: ipVersion,
});
const defaultListener = new alicloud.slb.Listener("default", {
aclId: defaultAcl.id,
aclStatus: "on",
aclType: "white",
backendPort: 80,
bandwidth: 10,
cookie: "testslblistenercookie",
cookieTimeout: 86400,
frontendPort: 80,
healthCheck: "on",
healthCheckConnectPort: 20,
healthCheckDomain: "ali.com",
healthCheckHttpCode: "http_2xx,http_3xx",
healthCheckInterval: 5,
healthCheckTimeout: 8,
healthCheckUri: "/cons",
healthyThreshold: 8,
idleTimeout: 30,
loadBalancerId: defaultLoadBalancer.id,
protocol: "http",
requestTimeout: 80,
stickySession: "on",
stickySessionType: "insert",
unhealthyThreshold: 8,
xForwardedFor: {
retriveSlbId: true,
retriveSlbIp: true,
},
});Create a Listener Resource
new Listener(name: string, args: ListenerArgs, opts?: CustomResourceOptions);def Listener(resource_name, opts=None, acl_id=None, acl_status=None, acl_type=None, backend_port=None, bandwidth=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, description=None, enable_http2=None, established_timeout=None, forward_port=None, frontend_port=None, gzip=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_method=None, health_check_timeout=None, health_check_type=None, health_check_uri=None, healthy_threshold=None, idle_timeout=None, instance_port=None, lb_port=None, lb_protocol=None, listener_forward=None, load_balancer_id=None, master_slave_server_group_id=None, persistence_timeout=None, protocol=None, request_timeout=None, scheduler=None, server_certificate_id=None, server_group_id=None, ssl_certificate_id=None, sticky_session=None, sticky_session_type=None, tls_cipher_policy=None, unhealthy_threshold=None, x_forwarded_for=None, __props__=None);func NewListener(ctx *Context, name string, args ListenerArgs, opts ...ResourceOption) (*Listener, error)public Listener(string name, ListenerArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ListenerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Listener Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Listener resource accepts the following input properties:
- Frontend
Port int Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- Load
Balancer stringId The Load Balancer ID which is used to launch a new listener.
- Protocol string
The protocol to listen on. Valid values are [
http,https,tcp,udp].- Acl
Id string the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- Acl
Status string Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- Acl
Type string Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- Backend
Port int Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- Bandwidth int
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Description string
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- Enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- Established
Timeout int Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- Forward
Port int The port that http redirect to https.
- Gzip bool
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check stringMethod The method of health check. Valid values: [“head”, “get”].
- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringType Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Idle
Timeout int Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- Instance
Port int - Lb
Port int - Lb
Protocol string - Listener
Forward string Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- Master
Slave stringServer Group Id - Persistence
Timeout int Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- Request
Timeout int Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- Server
Certificate stringId SLB Server certificate ID. It is required when
protocolishttps.- Server
Group stringId the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- Ssl
Certificate stringId It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Tls
Cipher stringPolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- XForwarded
For Pulumi.Ali Cloud. Slb. Inputs. Listener XForwarded For Args Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
- Frontend
Port int Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- Load
Balancer stringId The Load Balancer ID which is used to launch a new listener.
- Protocol string
The protocol to listen on. Valid values are [
http,https,tcp,udp].- Acl
Id string the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- Acl
Status string Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- Acl
Type string Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- Backend
Port int Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- Bandwidth int
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Description string
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- Enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- Established
Timeout int Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- Forward
Port int The port that http redirect to https.
- Gzip bool
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check stringMethod The method of health check. Valid values: [“head”, “get”].
- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringType Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Idle
Timeout int Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- Instance
Port int - Lb
Port int - Lb
Protocol string - Listener
Forward string Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- Master
Slave stringServer Group Id - Persistence
Timeout int Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- Request
Timeout int Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- Server
Certificate stringId SLB Server certificate ID. It is required when
protocolishttps.- Server
Group stringId the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- Ssl
Certificate stringId It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Tls
Cipher stringPolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- XForwarded
For ListenerXForwarded For Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
- frontend
Port number Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- load
Balancer stringId The Load Balancer ID which is used to launch a new listener.
- protocol string
The protocol to listen on. Valid values are [
http,https,tcp,udp].- acl
Id string the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- acl
Status string Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- acl
Type string Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- backend
Port number Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- bandwidth number
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- number
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete
Protection booleanValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- description string
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- established
Timeout number Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- forward
Port number The port that http redirect to https.
- gzip boolean
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- health
Check numberConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health
Check numberInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health
Check stringMethod The method of health check. Valid values: [“head”, “get”].
- health
Check numberTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health
Check stringType Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy
Threshold number Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- idle
Timeout number Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- instance
Port number - lb
Port number - lb
Protocol string - listener
Forward string Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- master
Slave stringServer Group Id - persistence
Timeout number Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- request
Timeout number Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- server
Certificate stringId SLB Server certificate ID. It is required when
protocolishttps.- server
Group stringId the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- ssl
Certificate stringId It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff.- sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- tls
Cipher stringPolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- unhealthy
Threshold number Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- x
Forwarded ListenerFor XForwarded For Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
- frontend_
port float Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- load_
balancer_ strid The Load Balancer ID which is used to launch a new listener.
- protocol str
The protocol to listen on. Valid values are [
http,https,tcp,udp].- acl_
id str the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- acl_
status str Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- acl_
type str Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- backend_
port float Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- bandwidth float
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- str
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- float
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete_
protection_ boolvalidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- description str
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- enable_
http2 str Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- established_
timeout float Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- forward_
port float The port that http redirect to https.
- gzip bool
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- health_
check str Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- health_
check_ floatconnect_ port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health_
check_ strdomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health_
check_ strhttp_ code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health_
check_ floatinterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health_
check_ strmethod The method of health check. Valid values: [“head”, “get”].
- health_
check_ floattimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health_
check_ strtype Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- health_
check_ struri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy_
threshold float Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- idle_
timeout float Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- instance_
port float - lb_
port float - lb_
protocol str - listener_
forward str Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- master_
slave_ strserver_ group_ id - persistence_
timeout float Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- request_
timeout float Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- scheduler str
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- server_
certificate_ strid SLB Server certificate ID. It is required when
protocolishttps.- server_
group_ strid the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- ssl_
certificate_ strid It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- sticky_
session str Whether to enable session persistence, Valid values are
onandoff. Default tooff.- sticky_
session_ strtype Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- tls_
cipher_ strpolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- unhealthy_
threshold float Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- x_
forwarded_ Dict[Listenerfor XForwarded For] Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
Outputs
All input properties are implicitly available as output properties. Additionally, the Listener resource produces the following output properties:
Look up an Existing Listener Resource
Get an existing Listener resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ListenerState, opts?: CustomResourceOptions): Listenerstatic get(resource_name, id, opts=None, acl_id=None, acl_status=None, acl_type=None, backend_port=None, bandwidth=None, cookie=None, cookie_timeout=None, delete_protection_validation=None, description=None, enable_http2=None, established_timeout=None, forward_port=None, frontend_port=None, gzip=None, health_check=None, health_check_connect_port=None, health_check_domain=None, health_check_http_code=None, health_check_interval=None, health_check_method=None, health_check_timeout=None, health_check_type=None, health_check_uri=None, healthy_threshold=None, idle_timeout=None, instance_port=None, lb_port=None, lb_protocol=None, listener_forward=None, load_balancer_id=None, master_slave_server_group_id=None, persistence_timeout=None, protocol=None, request_timeout=None, scheduler=None, server_certificate_id=None, server_group_id=None, ssl_certificate_id=None, sticky_session=None, sticky_session_type=None, tls_cipher_policy=None, unhealthy_threshold=None, x_forwarded_for=None, __props__=None);func GetListener(ctx *Context, name string, id IDInput, state *ListenerState, opts ...ResourceOption) (*Listener, error)public static Listener Get(string name, Input<string> id, ListenerState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Acl
Id string the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- Acl
Status string Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- Acl
Type string Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- Backend
Port int Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- Bandwidth int
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Description string
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- Enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- Established
Timeout int Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- Forward
Port int The port that http redirect to https.
- Frontend
Port int Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- Gzip bool
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check stringMethod The method of health check. Valid values: [“head”, “get”].
- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringType Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Idle
Timeout int Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- Instance
Port int - Lb
Port int - Lb
Protocol string - Listener
Forward string Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- Load
Balancer stringId The Load Balancer ID which is used to launch a new listener.
- Master
Slave stringServer Group Id - Persistence
Timeout int Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- Protocol string
The protocol to listen on. Valid values are [
http,https,tcp,udp].- Request
Timeout int Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- Server
Certificate stringId SLB Server certificate ID. It is required when
protocolishttps.- Server
Group stringId the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- Ssl
Certificate stringId It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Tls
Cipher stringPolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- XForwarded
For Pulumi.Ali Cloud. Slb. Inputs. Listener XForwarded For Args Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
- Acl
Id string the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- Acl
Status string Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- Acl
Type string Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- Backend
Port int Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- Bandwidth int
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- int
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- Delete
Protection boolValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- Description string
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- Enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- Established
Timeout int Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- Forward
Port int The port that http redirect to https.
- Frontend
Port int Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- Gzip bool
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- Health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- Health
Check intConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- Health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- Health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- Health
Check intInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- Health
Check stringMethod The method of health check. Valid values: [“head”, “get”].
- Health
Check intTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- Health
Check stringType Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- Health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- Healthy
Threshold int Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- Idle
Timeout int Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- Instance
Port int - Lb
Port int - Lb
Protocol string - Listener
Forward string Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- Load
Balancer stringId The Load Balancer ID which is used to launch a new listener.
- Master
Slave stringServer Group Id - Persistence
Timeout int Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- Protocol string
The protocol to listen on. Valid values are [
http,https,tcp,udp].- Request
Timeout int Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- Scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- Server
Certificate stringId SLB Server certificate ID. It is required when
protocolishttps.- Server
Group stringId the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- Ssl
Certificate stringId It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- Sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff.- Sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- Tls
Cipher stringPolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- Unhealthy
Threshold int Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- XForwarded
For ListenerXForwarded For Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
- acl
Id string the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- acl
Status string Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- acl
Type string Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- backend
Port number Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- bandwidth number
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- string
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- number
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete
Protection booleanValidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- description string
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- established
Timeout number Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- forward
Port number The port that http redirect to https.
- frontend
Port number Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- gzip boolean
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- health
Check string Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- health
Check numberConnect Port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health
Check stringDomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health
Check stringHttp Code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health
Check numberInterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health
Check stringMethod The method of health check. Valid values: [“head”, “get”].
- health
Check numberTimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health
Check stringType Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- health
Check stringUri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy
Threshold number Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- idle
Timeout number Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- instance
Port number - lb
Port number - lb
Protocol string - listener
Forward string Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- load
Balancer stringId The Load Balancer ID which is used to launch a new listener.
- master
Slave stringServer Group Id - persistence
Timeout number Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- protocol string
The protocol to listen on. Valid values are [
http,https,tcp,udp].- request
Timeout number Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- scheduler string
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- server
Certificate stringId SLB Server certificate ID. It is required when
protocolishttps.- server
Group stringId the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- ssl
Certificate stringId It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- sticky
Session string Whether to enable session persistence, Valid values are
onandoff. Default tooff.- sticky
Session stringType Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- tls
Cipher stringPolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- unhealthy
Threshold number Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- x
Forwarded ListenerFor XForwarded For Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
- acl_
id str the id of access control list to be apply on the listener, is the id of resource alicloud_slb_acl. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored.- acl_
status str Whether to enable “acl(access control list)”, the acl is specified by
acl_id. Valid values areonandoff. Default tooff.- acl_
type str Mode for handling the acl specified by acl_id. If
acl_statusis “on”, it is mandatory. Otherwise, it will be ignored. Valid values arewhiteandblack.whitemeans the Listener can only be accessed by client ip belongs to the acl;blackmeans the Listener can not be accessed by client ip belongs to the acl.- backend_
port float Port used by the Server Load Balancer instance backend. Valid value range: [1-65535].
- bandwidth float
Bandwidth peak of Listener. For the public network instance charged per traffic consumed, the Bandwidth on Listener can be set to -1, indicating the bandwidth peak is unlimited. Valid values are [-1, 1-1000] in Mbps.
- str
The cookie configured on the server. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “server”. Otherwise, it will be ignored. Valid value:String in line with RFC 2965, with length being 1- 200. It only contains characters such as ASCII codes, English letters and digits instead of the comma, semicolon or spacing, and it cannot start with $.- float
Cookie timeout. It is mandatory when
sticky_sessionis “on” andsticky_session_typeis “insert”. Otherwise, it will be ignored. Valid value range: [1-86400] in seconds.- delete_
protection_ boolvalidation Checking DeleteProtection of SLB instance before deleting. If true, this resource will not be deleted when its SLB instance enabled DeleteProtection. Default to false.
- description str
The description of slb listener. This description can have a string of 1 to 80 characters. Default value: null.
- enable_
http2 str Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- established_
timeout float Timeout of tcp listener established connection idle timeout. Valid value range: [10-900] in seconds. Default to 900.
- forward_
port float The port that http redirect to https.
- frontend_
port float Port used by the Server Load Balancer instance frontend. Valid value range: [1-65535].
- gzip bool
Whether to enable “Gzip Compression”. If enabled, files of specific file types will be compressed, otherwise, no files will be compressed. Default to true. Available in v1.13.0+.
- health_
check str Whether to enable health check. Valid values are
onandoff. TCP and UDP listener’s HealthCheck is always on, so it will be ignore when launching TCP or UDP listener.- health_
check_ floatconnect_ port Port used for health check. Valid value range: [1-65535]. Default to “None” means the backend server port is used.
- health_
check_ strdomain Domain name used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and only characters such as letters, digits, ‘-‘ and ‘.’ are allowed. When it is not set or empty, Server Load Balancer uses the private network IP address of each backend server as Domain used for health check.- health_
check_ strhttp_ code Regular health check HTTP status code. Multiple codes are segmented by “,”. It is required when
health_checkis on. Default tohttp_2xx. Valid values are:http_2xx,http_3xx,http_4xxandhttp_5xx.- health_
check_ floatinterval Time interval of health checks. It is required when
health_checkis on. Valid value range: [1-50] in seconds. Default to 2.- health_
check_ strmethod The method of health check. Valid values: [“head”, “get”].
- health_
check_ floattimeout Maximum timeout of each health check response. It is required when
health_checkis on. Valid value range: [1-300] in seconds. Default to 5. Note: Ifhealth_check_timeout<health_check_interval, its will be replaced byhealth_check_interval.- health_
check_ strtype Type of health check. Valid values are:
tcpandhttp. Default totcp. TCP supports TCP and HTTP health check mode, you can select the particular mode depending on your application.- health_
check_ struri URI used for health check. When it used to launch TCP listener,
health_check_typemust be “http”. Its length is limited to 1-80 and it must start with /. Only characters such as letters, digits, ‘-’, ‘/’, ‘.’, ‘%’, ‘?’, #’ and ‘&’ are allowed.- healthy_
threshold float Threshold determining the result of the health check is success. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- idle_
timeout float Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- instance_
port float - lb_
port float - lb_
protocol str - listener_
forward str Whether to enable http redirect to https, Valid values are
onandoff. Default tooff.- load_
balancer_ strid The Load Balancer ID which is used to launch a new listener.
- master_
slave_ strserver_ group_ id - persistence_
timeout float Timeout of connection persistence. Valid value range: [0-3600] in seconds. Default to 0 and means closing it.
- protocol str
The protocol to listen on. Valid values are [
http,https,tcp,udp].- request_
timeout float Timeout of http or https listener request (which does not get response from backend) timeout. Valid value range: [1-180] in seconds. Default to 60.
- scheduler str
Scheduling algorithm, Valid values are
wrr,rrandwlc. Default to “wrr”.- server_
certificate_ strid SLB Server certificate ID. It is required when
protocolishttps.- server_
group_ strid the id of server group to be apply on the listener, is the id of resource
alicloud.slb.ServerGroup.- ssl_
certificate_ strid It has been deprecated from 1.59.0 and using
server_certificate_idinstead.- sticky_
session str Whether to enable session persistence, Valid values are
onandoff. Default tooff.- sticky_
session_ strtype Mode for handling the cookie. If
sticky_sessionis “on”, it is mandatory. Otherwise, it will be ignored. Valid values areinsertandserver.insertmeans it is inserted from Server Load Balancer;servermeans the Server Load Balancer learns from the backend server.- tls_
cipher_ strpolicy Https listener TLS cipher policy. Valid values are
tls_cipher_policy_1_0,tls_cipher_policy_1_1,tls_cipher_policy_1_2,tls_cipher_policy_1_2_strict. Default totls_cipher_policy_1_0. Currently thetls_cipher_policycan not be updated when load balancer instance is “Shared-Performance”.- unhealthy_
threshold float Threshold determining the result of the health check is fail. It is required when
health_checkis on. Valid value range: [1-10] in seconds. Default to 3.- x_
forwarded_ Dict[Listenerfor XForwarded For] Whether to set additional HTTP Header field “X-Forwarded-For” (documented below). Available in v1.13.0+.
Supporting Types
ListenerXForwardedFor
- Retrive
Client boolIp - Retrive
Slb boolId Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.
- Retrive
Slb boolIp Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.
- Retrive
Slb boolProto Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.
- Retrive
Client boolIp - Retrive
Slb boolId Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.
- Retrive
Slb boolIp Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.
- Retrive
Slb boolProto Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.
- retrive
Client booleanIp - retrive
Slb booleanId Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.
- retrive
Slb booleanIp Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.
- retrive
Slb booleanProto Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.
- retrive
Client boolIp - retrive
Slb boolId Whether to use the XForwardedFor header to obtain the ID of the SLB instance. Default to false.
- retrive
Slb boolIp Whether to use the XForwardedFor_SLBIP header to obtain the public IP address of the SLB instance. Default to false.
- retrive
Slb boolProto Whether to use the XForwardedFor_proto header to obtain the protocol used by the listener. Default to false.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.