GetListeners
This data source provides the listeners related to a server load balancer of the current Alibaba Cloud user.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var sampleDs = Output.Create(AliCloud.Slb.GetListeners.InvokeAsync(new AliCloud.Slb.GetListenersArgs
{
LoadBalancerId = alicloud_slb.Sample_slb.Id,
}));
this.FirstSlbListenerProtocol = sampleDs.Apply(sampleDs => sampleDs.SlbListeners[0].Protocol);
}
[Output("firstSlbListenerProtocol")]
public Output<string> FirstSlbListenerProtocol { get; set; }
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
sample_ds = alicloud.slb.get_listeners(load_balancer_id=alicloud_slb["sample_slb"]["id"])
pulumi.export("firstSlbListenerProtocol", sample_ds.slb_listeners[0]["protocol"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const sampleDs = alicloud_slb_sample_slb.id.apply(id => alicloud.slb.getListeners({
loadBalancerId: id,
}, { async: true }));
export const firstSlbListenerProtocol = sampleDs.slbListeners[0].protocol;Using GetListeners
function getListeners(args: GetListenersArgs, opts?: InvokeOptions): Promise<GetListenersResult>function get_listeners(description_regex=None, frontend_port=None, load_balancer_id=None, output_file=None, protocol=None, opts=None)func GetListeners(ctx *Context, args *GetListenersArgs, opts ...InvokeOption) (*GetListenersResult, error)public static class GetListeners {
public static Task<GetListenersResult> InvokeAsync(GetListenersArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Load
Balancer stringId ID of the SLB with listeners.
- Description
Regex string A regex string to filter results by SLB listener description.
- Frontend
Port int Filter listeners by the specified frontend port.
- Output
File string - Protocol string
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.
- Load
Balancer stringId ID of the SLB with listeners.
- Description
Regex string A regex string to filter results by SLB listener description.
- Frontend
Port int Filter listeners by the specified frontend port.
- Output
File string - Protocol string
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.
- load
Balancer stringId ID of the SLB with listeners.
- description
Regex string A regex string to filter results by SLB listener description.
- frontend
Port number Filter listeners by the specified frontend port.
- output
File string - protocol string
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.
- load_
balancer_ strid ID of the SLB with listeners.
- description_
regex str A regex string to filter results by SLB listener description.
- frontend_
port float Filter listeners by the specified frontend port.
- output_
file str - protocol str
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.
GetListeners Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Load
Balancer stringId - Slb
Listeners List<Pulumi.Ali Cloud. Slb. Outputs. Get Listeners Slb Listener> A list of SLB listeners. Each element contains the following attributes:
- Description
Regex string - Frontend
Port int Frontend port used to receive incoming traffic and distribute it to the backend servers.
- Output
File string - Protocol string
Listener protocol. Possible values:
http,https,tcpandudp.
- Id string
The provider-assigned unique ID for this managed resource.
- Load
Balancer stringId - Slb
Listeners []GetListeners Slb Listener A list of SLB listeners. Each element contains the following attributes:
- Description
Regex string - Frontend
Port int Frontend port used to receive incoming traffic and distribute it to the backend servers.
- Output
File string - Protocol string
Listener protocol. Possible values:
http,https,tcpandudp.
- id string
The provider-assigned unique ID for this managed resource.
- load
Balancer stringId - slb
Listeners GetListeners Slb Listener[] A list of SLB listeners. Each element contains the following attributes:
- description
Regex string - frontend
Port number Frontend port used to receive incoming traffic and distribute it to the backend servers.
- output
File string - protocol string
Listener protocol. Possible values:
http,https,tcpandudp.
- id str
The provider-assigned unique ID for this managed resource.
- load_
balancer_ strid - slb_
listeners List[GetListeners Slb Listener] A list of SLB listeners. Each element contains the following attributes:
- description_
regex str - frontend_
port float Frontend port used to receive incoming traffic and distribute it to the backend servers.
- output_
file str - protocol str
Listener protocol. Possible values:
http,https,tcpandudp.
Supporting Types
GetListenersSlbListener
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Backend
Port int Port opened on the backend server to receive requests.
- Bandwidth int
Peak bandwidth. If the value is set to -1, the listener is not limited by bandwidth.
- Ca
Certificate stringId ID of the CA certificate (only required when two-way authentication is used). Only available when the protocol is
https.- string
Cookie configured by the backend server. Only available when the sticky_session_type is
server.- int
Cookie timeout in seconds. Only available when the sticky_session_type is
insert.- Description string
The description of slb listener.
- Enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- Established
Timeout int Connection timeout in seconds for the Layer 4 TCP listener. Only available when the protocol is
tcp.- Frontend
Port int Filter listeners by the specified frontend port.
- Gzip string
Indicate whether Gzip compression is enabled or not. Possible values are
onandoff. Only available when the protocol ishttporhttps.- Health
Check string Indicate whether health check is enabled of not. Possible values are
onandoff.- Health
Check intConnect Port Port used for health check.
- Health
Check intConnect Timeout Amount of time in seconds to wait for the response for a health check.
- Health
Check stringDomain Domain name used for health check. The SLB sends HTTP head requests to the backend server, the domain is useful when the backend server verifies the host field in the requests. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- Health
Check stringHttp Code HTTP status codes indicating that the health check is normal. It can contain several comma-separated values such as “http_2xx,http_3xx”. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- Health
Check intInterval Time interval between two consecutive health checks.
- Health
Check intTimeout Amount of time in seconds to wait for the response from a health check. If an ECS instance sends no response within the specified timeout period, the health check fails. Only available when the protocol is
httporhttps.- Health
Check stringType Health check method. Possible values are
tcpandhttp. Only available when the protocol istcp.- Health
Check stringUri URI used for health check. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- Healthy
Threshold int Number of consecutive successes of health check performed on the same ECS instance (from failure to success).
- Idle
Timeout int Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- Master
Slave stringServer Group Id ID of the active/standby server group.
- Persistence
Timeout int Timeout value of the TCP connection in seconds. If the value is 0, the session persistence function is disabled. Only available when the protocol is
tcp.- Protocol string
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.- 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
Algorithm used to distribute traffic. Possible values:
wrr(weighted round robin),wlc(weighted least connection) andrr(round robin).- Security
Status string Security status. Only available when the protocol is
https.- Server
Certificate stringId - Server
Group stringId ID of the linked VServer group.
- Ssl
Certificate stringId ID of the server certificate. Only available when the protocol is
https.- Status string
Listener status.
- Sticky
Session string Indicate whether session persistence is enabled or not. If enabled, all session requests from the same client are sent to the same backend server. Possible values are
onandoff. Only available when the protocol ishttporhttps.- Sticky
Session stringType Method used to handle the cookie. Possible values are
insert(cookie added to the response) andserver(cookie set by the backend server). Only available when the protocol ishttporhttpsand sticky_session ison.- 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.- Unhealthy
Threshold int Number of consecutive failures of health check performed on the same ECS instance (from success to failure).
- XForwarded
For string Indicate whether the HTTP header field “X-Forwarded-For” is added or not; it allows the backend server to know about the user’s IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- XForwarded
For stringSlb Id Indicate whether the HTTP header field “X-Forwarded-For_SLBID” is added or not; it allows the backend server to know about the SLB ID. Possible values are
onandoff. Only available when the protocol ishttporhttps.- XForwarded
For stringSlb Ip Indicate whether the HTTP header field “X-Forwarded-For_SLBIP” is added or not; it allows the backend server to know about the SLB IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- XForwarded
For stringSlb Proto Indicate whether the HTTP header field “X-Forwarded-For_proto” is added or not; it allows the backend server to know about the user’s protocol. Possible values are
onandoff. Only available when the protocol ishttporhttps.
- Backend
Port int Port opened on the backend server to receive requests.
- Bandwidth int
Peak bandwidth. If the value is set to -1, the listener is not limited by bandwidth.
- Ca
Certificate stringId ID of the CA certificate (only required when two-way authentication is used). Only available when the protocol is
https.- string
Cookie configured by the backend server. Only available when the sticky_session_type is
server.- int
Cookie timeout in seconds. Only available when the sticky_session_type is
insert.- Description string
The description of slb listener.
- Enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- Established
Timeout int Connection timeout in seconds for the Layer 4 TCP listener. Only available when the protocol is
tcp.- Frontend
Port int Filter listeners by the specified frontend port.
- Gzip string
Indicate whether Gzip compression is enabled or not. Possible values are
onandoff. Only available when the protocol ishttporhttps.- Health
Check string Indicate whether health check is enabled of not. Possible values are
onandoff.- Health
Check intConnect Port Port used for health check.
- Health
Check intConnect Timeout Amount of time in seconds to wait for the response for a health check.
- Health
Check stringDomain Domain name used for health check. The SLB sends HTTP head requests to the backend server, the domain is useful when the backend server verifies the host field in the requests. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- Health
Check stringHttp Code HTTP status codes indicating that the health check is normal. It can contain several comma-separated values such as “http_2xx,http_3xx”. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- Health
Check intInterval Time interval between two consecutive health checks.
- Health
Check intTimeout Amount of time in seconds to wait for the response from a health check. If an ECS instance sends no response within the specified timeout period, the health check fails. Only available when the protocol is
httporhttps.- Health
Check stringType Health check method. Possible values are
tcpandhttp. Only available when the protocol istcp.- Health
Check stringUri URI used for health check. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- Healthy
Threshold int Number of consecutive successes of health check performed on the same ECS instance (from failure to success).
- Idle
Timeout int Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- Master
Slave stringServer Group Id ID of the active/standby server group.
- Persistence
Timeout int Timeout value of the TCP connection in seconds. If the value is 0, the session persistence function is disabled. Only available when the protocol is
tcp.- Protocol string
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.- 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
Algorithm used to distribute traffic. Possible values:
wrr(weighted round robin),wlc(weighted least connection) andrr(round robin).- Security
Status string Security status. Only available when the protocol is
https.- Server
Certificate stringId - Server
Group stringId ID of the linked VServer group.
- Ssl
Certificate stringId ID of the server certificate. Only available when the protocol is
https.- Status string
Listener status.
- Sticky
Session string Indicate whether session persistence is enabled or not. If enabled, all session requests from the same client are sent to the same backend server. Possible values are
onandoff. Only available when the protocol ishttporhttps.- Sticky
Session stringType Method used to handle the cookie. Possible values are
insert(cookie added to the response) andserver(cookie set by the backend server). Only available when the protocol ishttporhttpsand sticky_session ison.- 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.- Unhealthy
Threshold int Number of consecutive failures of health check performed on the same ECS instance (from success to failure).
- XForwarded
For string Indicate whether the HTTP header field “X-Forwarded-For” is added or not; it allows the backend server to know about the user’s IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- XForwarded
For stringSlb Id Indicate whether the HTTP header field “X-Forwarded-For_SLBID” is added or not; it allows the backend server to know about the SLB ID. Possible values are
onandoff. Only available when the protocol ishttporhttps.- XForwarded
For stringSlb Ip Indicate whether the HTTP header field “X-Forwarded-For_SLBIP” is added or not; it allows the backend server to know about the SLB IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- XForwarded
For stringSlb Proto Indicate whether the HTTP header field “X-Forwarded-For_proto” is added or not; it allows the backend server to know about the user’s protocol. Possible values are
onandoff. Only available when the protocol ishttporhttps.
- backend
Port number Port opened on the backend server to receive requests.
- bandwidth number
Peak bandwidth. If the value is set to -1, the listener is not limited by bandwidth.
- ca
Certificate stringId ID of the CA certificate (only required when two-way authentication is used). Only available when the protocol is
https.- string
Cookie configured by the backend server. Only available when the sticky_session_type is
server.- number
Cookie timeout in seconds. Only available when the sticky_session_type is
insert.- description string
The description of slb listener.
- enable
Http2 string Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- established
Timeout number Connection timeout in seconds for the Layer 4 TCP listener. Only available when the protocol is
tcp.- frontend
Port number Filter listeners by the specified frontend port.
- gzip string
Indicate whether Gzip compression is enabled or not. Possible values are
onandoff. Only available when the protocol ishttporhttps.- health
Check string Indicate whether health check is enabled of not. Possible values are
onandoff.- health
Check numberConnect Port Port used for health check.
- health
Check numberConnect Timeout Amount of time in seconds to wait for the response for a health check.
- health
Check stringDomain Domain name used for health check. The SLB sends HTTP head requests to the backend server, the domain is useful when the backend server verifies the host field in the requests. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- health
Check stringHttp Code HTTP status codes indicating that the health check is normal. It can contain several comma-separated values such as “http_2xx,http_3xx”. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- health
Check numberInterval Time interval between two consecutive health checks.
- health
Check numberTimeout Amount of time in seconds to wait for the response from a health check. If an ECS instance sends no response within the specified timeout period, the health check fails. Only available when the protocol is
httporhttps.- health
Check stringType Health check method. Possible values are
tcpandhttp. Only available when the protocol istcp.- health
Check stringUri URI used for health check. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- healthy
Threshold number Number of consecutive successes of health check performed on the same ECS instance (from failure to success).
- idle
Timeout number Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- master
Slave stringServer Group Id ID of the active/standby server group.
- persistence
Timeout number Timeout value of the TCP connection in seconds. If the value is 0, the session persistence function is disabled. Only available when the protocol is
tcp.- protocol string
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.- 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
Algorithm used to distribute traffic. Possible values:
wrr(weighted round robin),wlc(weighted least connection) andrr(round robin).- security
Status string Security status. Only available when the protocol is
https.- server
Certificate stringId - server
Group stringId ID of the linked VServer group.
- ssl
Certificate stringId ID of the server certificate. Only available when the protocol is
https.- status string
Listener status.
- sticky
Session string Indicate whether session persistence is enabled or not. If enabled, all session requests from the same client are sent to the same backend server. Possible values are
onandoff. Only available when the protocol ishttporhttps.- sticky
Session stringType Method used to handle the cookie. Possible values are
insert(cookie added to the response) andserver(cookie set by the backend server). Only available when the protocol ishttporhttpsand sticky_session ison.- 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.- unhealthy
Threshold number Number of consecutive failures of health check performed on the same ECS instance (from success to failure).
- x
Forwarded stringFor Indicate whether the HTTP header field “X-Forwarded-For” is added or not; it allows the backend server to know about the user’s IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- x
Forwarded stringFor Slb Id Indicate whether the HTTP header field “X-Forwarded-For_SLBID” is added or not; it allows the backend server to know about the SLB ID. Possible values are
onandoff. Only available when the protocol ishttporhttps.- x
Forwarded stringFor Slb Ip Indicate whether the HTTP header field “X-Forwarded-For_SLBIP” is added or not; it allows the backend server to know about the SLB IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- x
Forwarded stringFor Slb Proto Indicate whether the HTTP header field “X-Forwarded-For_proto” is added or not; it allows the backend server to know about the user’s protocol. Possible values are
onandoff. Only available when the protocol ishttporhttps.
- backend_
port float Port opened on the backend server to receive requests.
- bandwidth float
Peak bandwidth. If the value is set to -1, the listener is not limited by bandwidth.
- ca
Certificate strId ID of the CA certificate (only required when two-way authentication is used). Only available when the protocol is
https.- str
Cookie configured by the backend server. Only available when the sticky_session_type is
server.- float
Cookie timeout in seconds. Only available when the sticky_session_type is
insert.- description str
The description of slb listener.
- enable_
http2 str Whether to enable https listener support http2 or not. Valid values are
onandoff. Default toon.- established_
timeout float Connection timeout in seconds for the Layer 4 TCP listener. Only available when the protocol is
tcp.- frontend_
port float Filter listeners by the specified frontend port.
- gzip str
Indicate whether Gzip compression is enabled or not. Possible values are
onandoff. Only available when the protocol ishttporhttps.- health
Check floatConnect Timeout Amount of time in seconds to wait for the response for a health check.
- health_
check str Indicate whether health check is enabled of not. Possible values are
onandoff.- health_
check_ floatconnect_ port Port used for health check.
- health_
check_ strdomain Domain name used for health check. The SLB sends HTTP head requests to the backend server, the domain is useful when the backend server verifies the host field in the requests. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- health_
check_ strhttp_ code HTTP status codes indicating that the health check is normal. It can contain several comma-separated values such as “http_2xx,http_3xx”. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- health_
check_ floatinterval Time interval between two consecutive health checks.
- health_
check_ floattimeout Amount of time in seconds to wait for the response from a health check. If an ECS instance sends no response within the specified timeout period, the health check fails. Only available when the protocol is
httporhttps.- health_
check_ strtype Health check method. Possible values are
tcpandhttp. Only available when the protocol istcp.- health_
check_ struri URI used for health check. Only available when the protocol is
http,httpsortcp(in this case health_check_type must behttp).- healthy_
threshold float Number of consecutive successes of health check performed on the same ECS instance (from failure to success).
- idle_
timeout float Timeout of http or https listener established connection idle timeout. Valid value range: [1-60] in seconds. Default to 15.
- master_
slave_ strserver_ group_ id ID of the active/standby server group.
- persistence_
timeout float Timeout value of the TCP connection in seconds. If the value is 0, the session persistence function is disabled. Only available when the protocol is
tcp.- protocol str
Filter listeners by the specified protocol. Valid values:
http,https,tcpandudp.- 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
Algorithm used to distribute traffic. Possible values:
wrr(weighted round robin),wlc(weighted least connection) andrr(round robin).- security
Status str Security status. Only available when the protocol is
https.- server_
certificate_ strid - server_
group_ strid ID of the linked VServer group.
- ssl_
certificate_ strid ID of the server certificate. Only available when the protocol is
https.- status str
Listener status.
- sticky_
session str Indicate whether session persistence is enabled or not. If enabled, all session requests from the same client are sent to the same backend server. Possible values are
onandoff. Only available when the protocol ishttporhttps.- sticky_
session_ strtype Method used to handle the cookie. Possible values are
insert(cookie added to the response) andserver(cookie set by the backend server). Only available when the protocol ishttporhttpsand sticky_session ison.- 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.- unhealthy_
threshold float Number of consecutive failures of health check performed on the same ECS instance (from success to failure).
- x
Forwarded strFor Slb Id Indicate whether the HTTP header field “X-Forwarded-For_SLBID” is added or not; it allows the backend server to know about the SLB ID. Possible values are
onandoff. Only available when the protocol ishttporhttps.- x
Forwarded strFor Slb Ip Indicate whether the HTTP header field “X-Forwarded-For_SLBIP” is added or not; it allows the backend server to know about the SLB IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.- x
Forwarded strFor Slb Proto Indicate whether the HTTP header field “X-Forwarded-For_proto” is added or not; it allows the backend server to know about the user’s protocol. Possible values are
onandoff. Only available when the protocol ishttporhttps.- x_
forwarded_ strfor Indicate whether the HTTP header field “X-Forwarded-For” is added or not; it allows the backend server to know about the user’s IP address. Possible values are
onandoff. Only available when the protocol ishttporhttps.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.