1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. nlb
  5. getListeners
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.nlb.getListeners

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Nlb Listeners of the current Alibaba Cloud user.

    NOTE: Available since v1.191.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.nlb.getListeners({
        ids: ["example_value"],
    });
    export const alicloudNlbListenerId1 = ids.then(ids => ids.listeners?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.nlb.get_listeners(ids=["example_value"])
    pulumi.export("alicloudNlbListenerId1", ids.listeners[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nlb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := nlb.GetListeners(ctx, &nlb.GetListenersArgs{
    			Ids: []string{
    				"example_value",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alicloudNlbListenerId1", ids.Listeners[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Nlb.GetListeners.Invoke(new()
        {
            Ids = new[]
            {
                "example_value",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudNlbListenerId1"] = ids.Apply(getListenersResult => getListenersResult.Listeners[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.nlb.NlbFunctions;
    import com.pulumi.alicloud.nlb.inputs.GetListenersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var ids = NlbFunctions.getListeners(GetListenersArgs.builder()
                .ids("example_value")
                .build());
    
            ctx.export("alicloudNlbListenerId1", ids.applyValue(getListenersResult -> getListenersResult.listeners()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:nlb:getListeners
          Arguments:
            ids:
              - example_value
    outputs:
      alicloudNlbListenerId1: ${ids.listeners[0].id}
    

    Using getListeners

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getListeners(args: GetListenersArgs, opts?: InvokeOptions): Promise<GetListenersResult>
    function getListenersOutput(args: GetListenersOutputArgs, opts?: InvokeOptions): Output<GetListenersResult>
    def get_listeners(ids: Optional[Sequence[str]] = None,
                      listener_protocol: Optional[str] = None,
                      load_balancer_ids: Optional[Sequence[str]] = None,
                      output_file: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetListenersResult
    def get_listeners_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      listener_protocol: Optional[pulumi.Input[str]] = None,
                      load_balancer_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetListenersResult]
    func GetListeners(ctx *Context, args *GetListenersArgs, opts ...InvokeOption) (*GetListenersResult, error)
    func GetListenersOutput(ctx *Context, args *GetListenersOutputArgs, opts ...InvokeOption) GetListenersResultOutput

    > Note: This function is named GetListeners in the Go SDK.

    public static class GetListeners 
    {
        public static Task<GetListenersResult> InvokeAsync(GetListenersArgs args, InvokeOptions? opts = null)
        public static Output<GetListenersResult> Invoke(GetListenersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetListenersResult> getListeners(GetListenersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:nlb/getListeners:getListeners
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Listener IDs.
    ListenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    LoadBalancerIds List<string>
    The ID of the NLB instance. You can specify at most 20 IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Listener IDs.
    ListenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    LoadBalancerIds []string
    The ID of the NLB instance. You can specify at most 20 IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Listener IDs.
    listenerProtocol String
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerIds List<String>
    The ID of the NLB instance. You can specify at most 20 IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Listener IDs.
    listenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerIds string[]
    The ID of the NLB instance. You can specify at most 20 IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Listener IDs.
    listener_protocol str
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    load_balancer_ids Sequence[str]
    The ID of the NLB instance. You can specify at most 20 IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Listener IDs.
    listenerProtocol String
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerIds List<String>
    The ID of the NLB instance. You can specify at most 20 IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getListeners Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Listeners List<Pulumi.AliCloud.Nlb.Outputs.GetListenersListener>
    A list of Nlb Listeners. Each element contains the following attributes:
    ListenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    LoadBalancerIds List<string>
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Listeners []GetListenersListener
    A list of Nlb Listeners. Each element contains the following attributes:
    ListenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    LoadBalancerIds []string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    listeners List<GetListenersListener>
    A list of Nlb Listeners. Each element contains the following attributes:
    listenerProtocol String
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerIds List<String>
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    listeners GetListenersListener[]
    A list of Nlb Listeners. Each element contains the following attributes:
    listenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerIds string[]
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    listeners Sequence[GetListenersListener]
    A list of Nlb Listeners. Each element contains the following attributes:
    listener_protocol str
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    load_balancer_ids Sequence[str]
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    listeners List<Property Map>
    A list of Nlb Listeners. Each element contains the following attributes:
    listenerProtocol String
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerIds List<String>
    outputFile String

    Supporting Types

    GetListenersListener

    AlpnEnabled bool
    ndicates whether Application-Layer Protocol Negotiation (ALPN) is enabled.
    AlpnPolicy string
    The ALPN policy.
    CaCertificateIds List<string>
    CA certificate list information. Currently, only one CA certificate can be added. NOTE: This parameter only takes effect for TCPSSL listeners.
    CaEnabled bool
    Whether to start two-way authentication.
    CertificateIds List<string>
    Server certificate list information. Currently, only one server certificate can be added. This parameter only takes effect for TCPSSL listeners.
    Cps int
    The new connection speed limit for a network-based load balancing instance per second. Valid values: 0 ~ 1000000. 0 indicates unlimited speed.
    EndPort string
    Full port listening end port. Valid values: 0 ~ 65535. The value of the end port is less than the start port.
    Id string
    The ID of the Nlb Listener.
    IdleTimeout int
    Connection idle timeout time. Unit: seconds. Valid values: 1 ~ 900.
    ListenerDescription string
    Custom listener name. The length is limited to 2 to 256 characters, supports Chinese and English letters, and can include numbers, commas (,), half-width periods (.), half-width semicolons (;), forward slashes (/), at(@), underscores (_), and dashes (-).
    ListenerId string
    The ID of the listener.
    ListenerPort int
    Listening port. Valid values: 0 ~ 65535. 0: indicates that full port listening is used. When set to 0, you must configure StartPort and EndPort.
    ListenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    LoadBalancerId string
    The ID of the network-based server load balancer instance.
    Mss int
    The maximum segment size of the TCP message. Unit: Bytes. Valid values: 0 ~ 1500. 0 indicates that the MSS value of the TCP message is not modified. only TCP and TCPSSL listeners support this field value.
    ProxyProtocolEnabled bool
    Whether to enable the Proxy Protocol to carry the source address of the client to the backend server.
    SecSensorEnabled bool
    Indicates whether fine-grained monitoring is enabled.
    SecurityPolicyId string
    Security policy ID. Support system security policies and custom security policies. Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, or tls_cipher_policy_1_2_strict_with_1_3. Note: This parameter only takes effect for TCPSSL listeners.
    ServerGroupId string
    The ID of the server group.
    StartPort string
    Full Port listens to the starting port. Valid values: 0 ~ 65535.
    Status string
    The status of the resource.
    AlpnEnabled bool
    ndicates whether Application-Layer Protocol Negotiation (ALPN) is enabled.
    AlpnPolicy string
    The ALPN policy.
    CaCertificateIds []string
    CA certificate list information. Currently, only one CA certificate can be added. NOTE: This parameter only takes effect for TCPSSL listeners.
    CaEnabled bool
    Whether to start two-way authentication.
    CertificateIds []string
    Server certificate list information. Currently, only one server certificate can be added. This parameter only takes effect for TCPSSL listeners.
    Cps int
    The new connection speed limit for a network-based load balancing instance per second. Valid values: 0 ~ 1000000. 0 indicates unlimited speed.
    EndPort string
    Full port listening end port. Valid values: 0 ~ 65535. The value of the end port is less than the start port.
    Id string
    The ID of the Nlb Listener.
    IdleTimeout int
    Connection idle timeout time. Unit: seconds. Valid values: 1 ~ 900.
    ListenerDescription string
    Custom listener name. The length is limited to 2 to 256 characters, supports Chinese and English letters, and can include numbers, commas (,), half-width periods (.), half-width semicolons (;), forward slashes (/), at(@), underscores (_), and dashes (-).
    ListenerId string
    The ID of the listener.
    ListenerPort int
    Listening port. Valid values: 0 ~ 65535. 0: indicates that full port listening is used. When set to 0, you must configure StartPort and EndPort.
    ListenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    LoadBalancerId string
    The ID of the network-based server load balancer instance.
    Mss int
    The maximum segment size of the TCP message. Unit: Bytes. Valid values: 0 ~ 1500. 0 indicates that the MSS value of the TCP message is not modified. only TCP and TCPSSL listeners support this field value.
    ProxyProtocolEnabled bool
    Whether to enable the Proxy Protocol to carry the source address of the client to the backend server.
    SecSensorEnabled bool
    Indicates whether fine-grained monitoring is enabled.
    SecurityPolicyId string
    Security policy ID. Support system security policies and custom security policies. Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, or tls_cipher_policy_1_2_strict_with_1_3. Note: This parameter only takes effect for TCPSSL listeners.
    ServerGroupId string
    The ID of the server group.
    StartPort string
    Full Port listens to the starting port. Valid values: 0 ~ 65535.
    Status string
    The status of the resource.
    alpnEnabled Boolean
    ndicates whether Application-Layer Protocol Negotiation (ALPN) is enabled.
    alpnPolicy String
    The ALPN policy.
    caCertificateIds List<String>
    CA certificate list information. Currently, only one CA certificate can be added. NOTE: This parameter only takes effect for TCPSSL listeners.
    caEnabled Boolean
    Whether to start two-way authentication.
    certificateIds List<String>
    Server certificate list information. Currently, only one server certificate can be added. This parameter only takes effect for TCPSSL listeners.
    cps Integer
    The new connection speed limit for a network-based load balancing instance per second. Valid values: 0 ~ 1000000. 0 indicates unlimited speed.
    endPort String
    Full port listening end port. Valid values: 0 ~ 65535. The value of the end port is less than the start port.
    id String
    The ID of the Nlb Listener.
    idleTimeout Integer
    Connection idle timeout time. Unit: seconds. Valid values: 1 ~ 900.
    listenerDescription String
    Custom listener name. The length is limited to 2 to 256 characters, supports Chinese and English letters, and can include numbers, commas (,), half-width periods (.), half-width semicolons (;), forward slashes (/), at(@), underscores (_), and dashes (-).
    listenerId String
    The ID of the listener.
    listenerPort Integer
    Listening port. Valid values: 0 ~ 65535. 0: indicates that full port listening is used. When set to 0, you must configure StartPort and EndPort.
    listenerProtocol String
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerId String
    The ID of the network-based server load balancer instance.
    mss Integer
    The maximum segment size of the TCP message. Unit: Bytes. Valid values: 0 ~ 1500. 0 indicates that the MSS value of the TCP message is not modified. only TCP and TCPSSL listeners support this field value.
    proxyProtocolEnabled Boolean
    Whether to enable the Proxy Protocol to carry the source address of the client to the backend server.
    secSensorEnabled Boolean
    Indicates whether fine-grained monitoring is enabled.
    securityPolicyId String
    Security policy ID. Support system security policies and custom security policies. Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, or tls_cipher_policy_1_2_strict_with_1_3. Note: This parameter only takes effect for TCPSSL listeners.
    serverGroupId String
    The ID of the server group.
    startPort String
    Full Port listens to the starting port. Valid values: 0 ~ 65535.
    status String
    The status of the resource.
    alpnEnabled boolean
    ndicates whether Application-Layer Protocol Negotiation (ALPN) is enabled.
    alpnPolicy string
    The ALPN policy.
    caCertificateIds string[]
    CA certificate list information. Currently, only one CA certificate can be added. NOTE: This parameter only takes effect for TCPSSL listeners.
    caEnabled boolean
    Whether to start two-way authentication.
    certificateIds string[]
    Server certificate list information. Currently, only one server certificate can be added. This parameter only takes effect for TCPSSL listeners.
    cps number
    The new connection speed limit for a network-based load balancing instance per second. Valid values: 0 ~ 1000000. 0 indicates unlimited speed.
    endPort string
    Full port listening end port. Valid values: 0 ~ 65535. The value of the end port is less than the start port.
    id string
    The ID of the Nlb Listener.
    idleTimeout number
    Connection idle timeout time. Unit: seconds. Valid values: 1 ~ 900.
    listenerDescription string
    Custom listener name. The length is limited to 2 to 256 characters, supports Chinese and English letters, and can include numbers, commas (,), half-width periods (.), half-width semicolons (;), forward slashes (/), at(@), underscores (_), and dashes (-).
    listenerId string
    The ID of the listener.
    listenerPort number
    Listening port. Valid values: 0 ~ 65535. 0: indicates that full port listening is used. When set to 0, you must configure StartPort and EndPort.
    listenerProtocol string
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerId string
    The ID of the network-based server load balancer instance.
    mss number
    The maximum segment size of the TCP message. Unit: Bytes. Valid values: 0 ~ 1500. 0 indicates that the MSS value of the TCP message is not modified. only TCP and TCPSSL listeners support this field value.
    proxyProtocolEnabled boolean
    Whether to enable the Proxy Protocol to carry the source address of the client to the backend server.
    secSensorEnabled boolean
    Indicates whether fine-grained monitoring is enabled.
    securityPolicyId string
    Security policy ID. Support system security policies and custom security policies. Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, or tls_cipher_policy_1_2_strict_with_1_3. Note: This parameter only takes effect for TCPSSL listeners.
    serverGroupId string
    The ID of the server group.
    startPort string
    Full Port listens to the starting port. Valid values: 0 ~ 65535.
    status string
    The status of the resource.
    alpn_enabled bool
    ndicates whether Application-Layer Protocol Negotiation (ALPN) is enabled.
    alpn_policy str
    The ALPN policy.
    ca_certificate_ids Sequence[str]
    CA certificate list information. Currently, only one CA certificate can be added. NOTE: This parameter only takes effect for TCPSSL listeners.
    ca_enabled bool
    Whether to start two-way authentication.
    certificate_ids Sequence[str]
    Server certificate list information. Currently, only one server certificate can be added. This parameter only takes effect for TCPSSL listeners.
    cps int
    The new connection speed limit for a network-based load balancing instance per second. Valid values: 0 ~ 1000000. 0 indicates unlimited speed.
    end_port str
    Full port listening end port. Valid values: 0 ~ 65535. The value of the end port is less than the start port.
    id str
    The ID of the Nlb Listener.
    idle_timeout int
    Connection idle timeout time. Unit: seconds. Valid values: 1 ~ 900.
    listener_description str
    Custom listener name. The length is limited to 2 to 256 characters, supports Chinese and English letters, and can include numbers, commas (,), half-width periods (.), half-width semicolons (;), forward slashes (/), at(@), underscores (_), and dashes (-).
    listener_id str
    The ID of the listener.
    listener_port int
    Listening port. Valid values: 0 ~ 65535. 0: indicates that full port listening is used. When set to 0, you must configure StartPort and EndPort.
    listener_protocol str
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    load_balancer_id str
    The ID of the network-based server load balancer instance.
    mss int
    The maximum segment size of the TCP message. Unit: Bytes. Valid values: 0 ~ 1500. 0 indicates that the MSS value of the TCP message is not modified. only TCP and TCPSSL listeners support this field value.
    proxy_protocol_enabled bool
    Whether to enable the Proxy Protocol to carry the source address of the client to the backend server.
    sec_sensor_enabled bool
    Indicates whether fine-grained monitoring is enabled.
    security_policy_id str
    Security policy ID. Support system security policies and custom security policies. Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, or tls_cipher_policy_1_2_strict_with_1_3. Note: This parameter only takes effect for TCPSSL listeners.
    server_group_id str
    The ID of the server group.
    start_port str
    Full Port listens to the starting port. Valid values: 0 ~ 65535.
    status str
    The status of the resource.
    alpnEnabled Boolean
    ndicates whether Application-Layer Protocol Negotiation (ALPN) is enabled.
    alpnPolicy String
    The ALPN policy.
    caCertificateIds List<String>
    CA certificate list information. Currently, only one CA certificate can be added. NOTE: This parameter only takes effect for TCPSSL listeners.
    caEnabled Boolean
    Whether to start two-way authentication.
    certificateIds List<String>
    Server certificate list information. Currently, only one server certificate can be added. This parameter only takes effect for TCPSSL listeners.
    cps Number
    The new connection speed limit for a network-based load balancing instance per second. Valid values: 0 ~ 1000000. 0 indicates unlimited speed.
    endPort String
    Full port listening end port. Valid values: 0 ~ 65535. The value of the end port is less than the start port.
    id String
    The ID of the Nlb Listener.
    idleTimeout Number
    Connection idle timeout time. Unit: seconds. Valid values: 1 ~ 900.
    listenerDescription String
    Custom listener name. The length is limited to 2 to 256 characters, supports Chinese and English letters, and can include numbers, commas (,), half-width periods (.), half-width semicolons (;), forward slashes (/), at(@), underscores (_), and dashes (-).
    listenerId String
    The ID of the listener.
    listenerPort Number
    Listening port. Valid values: 0 ~ 65535. 0: indicates that full port listening is used. When set to 0, you must configure StartPort and EndPort.
    listenerProtocol String
    The listening protocol. Valid values: TCP, UDP, or TCPSSL.
    loadBalancerId String
    The ID of the network-based server load balancer instance.
    mss Number
    The maximum segment size of the TCP message. Unit: Bytes. Valid values: 0 ~ 1500. 0 indicates that the MSS value of the TCP message is not modified. only TCP and TCPSSL listeners support this field value.
    proxyProtocolEnabled Boolean
    Whether to enable the Proxy Protocol to carry the source address of the client to the backend server.
    secSensorEnabled Boolean
    Indicates whether fine-grained monitoring is enabled.
    securityPolicyId String
    Security policy ID. Support system security policies and custom security policies. Valid values: tls_cipher_policy_1_0, tls_cipher_policy_1_1, tls_cipher_policy_1_2, tls_cipher_policy_1_2_strict, or tls_cipher_policy_1_2_strict_with_1_3. Note: This parameter only takes effect for TCPSSL listeners.
    serverGroupId String
    The ID of the server group.
    startPort String
    Full Port listens to the starting port. Valid values: 0 ~ 65535.
    status String
    The status of the resource.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi