1. Packages
  2. Ucloud Provider
  3. API Docs
  4. getLbListeners
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.getLbListeners

Explore with Pulumi AI

ucloud logo
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

    This data source provides a list of Load Balancer Listener resources according to their Load Balancer Listener ID.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getLbListeners({
        loadBalancerId: "ulb-xxx",
    });
    export const first = example.then(example => example.lbListeners?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_lb_listeners(load_balancer_id="ulb-xxx")
    pulumi.export("first", example.lb_listeners[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ucloud.GetLbListeners(ctx, &ucloud.GetLbListenersArgs{
    			LoadBalancerId: "ulb-xxx",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.LbListeners[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetLbListeners.Invoke(new()
        {
            LoadBalancerId = "ulb-xxx",
        });
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getLbListenersResult => getLbListenersResult.LbListeners[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ucloud.UcloudFunctions;
    import com.pulumi.ucloud.inputs.GetLbListenersArgs;
    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 example = UcloudFunctions.getLbListeners(GetLbListenersArgs.builder()
                .loadBalancerId("ulb-xxx")
                .build());
    
            ctx.export("first", example.applyValue(getLbListenersResult -> getLbListenersResult.lbListeners()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getLbListeners
          arguments:
            loadBalancerId: ulb-xxx
    outputs:
      first: ${example.lbListeners[0].id}
    

    Using getLbListeners

    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 getLbListeners(args: GetLbListenersArgs, opts?: InvokeOptions): Promise<GetLbListenersResult>
    function getLbListenersOutput(args: GetLbListenersOutputArgs, opts?: InvokeOptions): Output<GetLbListenersResult>
    def get_lb_listeners(id: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         load_balancer_id: Optional[str] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetLbListenersResult
    def get_lb_listeners_output(id: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         load_balancer_id: Optional[pulumi.Input[str]] = None,
                         name_regex: Optional[pulumi.Input[str]] = None,
                         output_file: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetLbListenersResult]
    func GetLbListeners(ctx *Context, args *GetLbListenersArgs, opts ...InvokeOption) (*GetLbListenersResult, error)
    func GetLbListenersOutput(ctx *Context, args *GetLbListenersOutputArgs, opts ...InvokeOption) GetLbListenersResultOutput

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

    public static class GetLbListeners 
    {
        public static Task<GetLbListenersResult> InvokeAsync(GetLbListenersArgs args, InvokeOptions? opts = null)
        public static Output<GetLbListenersResult> Invoke(GetLbListenersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLbListenersResult> getLbListeners(GetLbListenersArgs args, InvokeOptions options)
    public static Output<GetLbListenersResult> getLbListeners(GetLbListenersArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getLbListeners:getLbListeners
      arguments:
        # arguments dictionary

    The following arguments are supported:

    LoadBalancerId string
    The ID of a load balancer.


    Id string
    The ID of LB Listener.
    Ids List<string>
    A list of LB Listener IDs, all the LB Listeners belong to this region will be retrieved if the ID is [].
    NameRegex string
    A regex string to filter resulting lb listeners by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    LoadBalancerId string
    The ID of a load balancer.


    Id string
    The ID of LB Listener.
    Ids []string
    A list of LB Listener IDs, all the LB Listeners belong to this region will be retrieved if the ID is [].
    NameRegex string
    A regex string to filter resulting lb listeners by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    loadBalancerId String
    The ID of a load balancer.


    id String
    The ID of LB Listener.
    ids List<String>
    A list of LB Listener IDs, all the LB Listeners belong to this region will be retrieved if the ID is [].
    nameRegex String
    A regex string to filter resulting lb listeners by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    loadBalancerId string
    The ID of a load balancer.


    id string
    The ID of LB Listener.
    ids string[]
    A list of LB Listener IDs, all the LB Listeners belong to this region will be retrieved if the ID is [].
    nameRegex string
    A regex string to filter resulting lb listeners by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    load_balancer_id str
    The ID of a load balancer.


    id str
    The ID of LB Listener.
    ids Sequence[str]
    A list of LB Listener IDs, all the LB Listeners belong to this region will be retrieved if the ID is [].
    name_regex str
    A regex string to filter resulting lb listeners by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    loadBalancerId String
    The ID of a load balancer.


    id String
    The ID of LB Listener.
    ids List<String>
    A list of LB Listener IDs, all the LB Listeners belong to this region will be retrieved if the ID is [].
    nameRegex String
    A regex string to filter resulting lb listeners by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getLbListeners Result

    The following output properties are available:

    Id string
    The ID of LB Listener.
    Ids List<string>
    LbListeners List<GetLbListenersLbListener>
    It is a nested type which documented below.
    LoadBalancerId string
    TotalCount double
    Total number of LB listeners that satisfy the condition.
    NameRegex string
    OutputFile string
    Id string
    The ID of LB Listener.
    Ids []string
    LbListeners []GetLbListenersLbListener
    It is a nested type which documented below.
    LoadBalancerId string
    TotalCount float64
    Total number of LB listeners that satisfy the condition.
    NameRegex string
    OutputFile string
    id String
    The ID of LB Listener.
    ids List<String>
    lbListeners List<GetLbListenersLbListener>
    It is a nested type which documented below.
    loadBalancerId String
    totalCount Double
    Total number of LB listeners that satisfy the condition.
    nameRegex String
    outputFile String
    id string
    The ID of LB Listener.
    ids string[]
    lbListeners GetLbListenersLbListener[]
    It is a nested type which documented below.
    loadBalancerId string
    totalCount number
    Total number of LB listeners that satisfy the condition.
    nameRegex string
    outputFile string
    id str
    The ID of LB Listener.
    ids Sequence[str]
    lb_listeners Sequence[GetLbListenersLbListener]
    It is a nested type which documented below.
    load_balancer_id str
    total_count float
    Total number of LB listeners that satisfy the condition.
    name_regex str
    output_file str
    id String
    The ID of LB Listener.
    ids List<String>
    lbListeners List<Property Map>
    It is a nested type which documented below.
    loadBalancerId String
    totalCount Number
    Total number of LB listeners that satisfy the condition.
    nameRegex String
    outputFile String

    Supporting Types

    GetLbListenersLbListener

    Domain string
    Health check domain checking.
    HealthCheckType string
    Health check method. Possible values are port as port checking and path as http checking.
    Id string
    The ID of LB Listener.
    IdleTimeout double
    Amount of time in seconds to wait for the response for in between two sessions if listen_type is request_proxy, range: 0-86400. Amount of time in seconds to wait for one session if listen_type is packets_transmit, range: 60-900. The session will be closed as soon as no response if it is 0.
    ListenType string
    The type of LB Listener. Possible values are request_proxy and packets_transmit.
    Method string
    The load balancer method in which the listener is. Possible values are: roundrobin, source, consistent_hash, source_port , consistent_hash_port, weight_roundrobin and leastconn.

    • The consistent_hash, source_port , consistent_hash_port, roundrobin, source and weight_roundrobin are valid if listen_type is packets_transmit.
    • The rundrobin, source and weight_roundrobin and leastconn are vaild if listen_type is request_proxy.
    Name string
    The name of LB Listener.
    Path string
    Health check path checking.
    Persistence string
    Indicate whether the persistence session is enabled, it is invaild if persistence_type is none, an auto-generated string will be exported if persistence_type is server_insert, a custom string will be exported if persistence_type is user_defined.
    PersistenceType string
    The type of session persistence of LB Listener. Possible values are: none as disabled, server_insert as auto-generated string and user_defined as cutom string. (Default: none).
    Port double
    Port opened on the LB Listener to receive requests, range: 1-65535.
    Protocol string
    LB Listener protocol. Possible values: http, https if listen_type is request_proxy, tcp and udp if listen_type is packets_transmit.
    Status string
    LB Listener status. Possible values are: allNormal for all resource functioning well, partNormal for partial resource functioning well and allException for all resource functioning exceptional.
    Domain string
    Health check domain checking.
    HealthCheckType string
    Health check method. Possible values are port as port checking and path as http checking.
    Id string
    The ID of LB Listener.
    IdleTimeout float64
    Amount of time in seconds to wait for the response for in between two sessions if listen_type is request_proxy, range: 0-86400. Amount of time in seconds to wait for one session if listen_type is packets_transmit, range: 60-900. The session will be closed as soon as no response if it is 0.
    ListenType string
    The type of LB Listener. Possible values are request_proxy and packets_transmit.
    Method string
    The load balancer method in which the listener is. Possible values are: roundrobin, source, consistent_hash, source_port , consistent_hash_port, weight_roundrobin and leastconn.

    • The consistent_hash, source_port , consistent_hash_port, roundrobin, source and weight_roundrobin are valid if listen_type is packets_transmit.
    • The rundrobin, source and weight_roundrobin and leastconn are vaild if listen_type is request_proxy.
    Name string
    The name of LB Listener.
    Path string
    Health check path checking.
    Persistence string
    Indicate whether the persistence session is enabled, it is invaild if persistence_type is none, an auto-generated string will be exported if persistence_type is server_insert, a custom string will be exported if persistence_type is user_defined.
    PersistenceType string
    The type of session persistence of LB Listener. Possible values are: none as disabled, server_insert as auto-generated string and user_defined as cutom string. (Default: none).
    Port float64
    Port opened on the LB Listener to receive requests, range: 1-65535.
    Protocol string
    LB Listener protocol. Possible values: http, https if listen_type is request_proxy, tcp and udp if listen_type is packets_transmit.
    Status string
    LB Listener status. Possible values are: allNormal for all resource functioning well, partNormal for partial resource functioning well and allException for all resource functioning exceptional.
    domain String
    Health check domain checking.
    healthCheckType String
    Health check method. Possible values are port as port checking and path as http checking.
    id String
    The ID of LB Listener.
    idleTimeout Double
    Amount of time in seconds to wait for the response for in between two sessions if listen_type is request_proxy, range: 0-86400. Amount of time in seconds to wait for one session if listen_type is packets_transmit, range: 60-900. The session will be closed as soon as no response if it is 0.
    listenType String
    The type of LB Listener. Possible values are request_proxy and packets_transmit.
    method String
    The load balancer method in which the listener is. Possible values are: roundrobin, source, consistent_hash, source_port , consistent_hash_port, weight_roundrobin and leastconn.

    • The consistent_hash, source_port , consistent_hash_port, roundrobin, source and weight_roundrobin are valid if listen_type is packets_transmit.
    • The rundrobin, source and weight_roundrobin and leastconn are vaild if listen_type is request_proxy.
    name String
    The name of LB Listener.
    path String
    Health check path checking.
    persistence String
    Indicate whether the persistence session is enabled, it is invaild if persistence_type is none, an auto-generated string will be exported if persistence_type is server_insert, a custom string will be exported if persistence_type is user_defined.
    persistenceType String
    The type of session persistence of LB Listener. Possible values are: none as disabled, server_insert as auto-generated string and user_defined as cutom string. (Default: none).
    port Double
    Port opened on the LB Listener to receive requests, range: 1-65535.
    protocol String
    LB Listener protocol. Possible values: http, https if listen_type is request_proxy, tcp and udp if listen_type is packets_transmit.
    status String
    LB Listener status. Possible values are: allNormal for all resource functioning well, partNormal for partial resource functioning well and allException for all resource functioning exceptional.
    domain string
    Health check domain checking.
    healthCheckType string
    Health check method. Possible values are port as port checking and path as http checking.
    id string
    The ID of LB Listener.
    idleTimeout number
    Amount of time in seconds to wait for the response for in between two sessions if listen_type is request_proxy, range: 0-86400. Amount of time in seconds to wait for one session if listen_type is packets_transmit, range: 60-900. The session will be closed as soon as no response if it is 0.
    listenType string
    The type of LB Listener. Possible values are request_proxy and packets_transmit.
    method string
    The load balancer method in which the listener is. Possible values are: roundrobin, source, consistent_hash, source_port , consistent_hash_port, weight_roundrobin and leastconn.

    • The consistent_hash, source_port , consistent_hash_port, roundrobin, source and weight_roundrobin are valid if listen_type is packets_transmit.
    • The rundrobin, source and weight_roundrobin and leastconn are vaild if listen_type is request_proxy.
    name string
    The name of LB Listener.
    path string
    Health check path checking.
    persistence string
    Indicate whether the persistence session is enabled, it is invaild if persistence_type is none, an auto-generated string will be exported if persistence_type is server_insert, a custom string will be exported if persistence_type is user_defined.
    persistenceType string
    The type of session persistence of LB Listener. Possible values are: none as disabled, server_insert as auto-generated string and user_defined as cutom string. (Default: none).
    port number
    Port opened on the LB Listener to receive requests, range: 1-65535.
    protocol string
    LB Listener protocol. Possible values: http, https if listen_type is request_proxy, tcp and udp if listen_type is packets_transmit.
    status string
    LB Listener status. Possible values are: allNormal for all resource functioning well, partNormal for partial resource functioning well and allException for all resource functioning exceptional.
    domain str
    Health check domain checking.
    health_check_type str
    Health check method. Possible values are port as port checking and path as http checking.
    id str
    The ID of LB Listener.
    idle_timeout float
    Amount of time in seconds to wait for the response for in between two sessions if listen_type is request_proxy, range: 0-86400. Amount of time in seconds to wait for one session if listen_type is packets_transmit, range: 60-900. The session will be closed as soon as no response if it is 0.
    listen_type str
    The type of LB Listener. Possible values are request_proxy and packets_transmit.
    method str
    The load balancer method in which the listener is. Possible values are: roundrobin, source, consistent_hash, source_port , consistent_hash_port, weight_roundrobin and leastconn.

    • The consistent_hash, source_port , consistent_hash_port, roundrobin, source and weight_roundrobin are valid if listen_type is packets_transmit.
    • The rundrobin, source and weight_roundrobin and leastconn are vaild if listen_type is request_proxy.
    name str
    The name of LB Listener.
    path str
    Health check path checking.
    persistence str
    Indicate whether the persistence session is enabled, it is invaild if persistence_type is none, an auto-generated string will be exported if persistence_type is server_insert, a custom string will be exported if persistence_type is user_defined.
    persistence_type str
    The type of session persistence of LB Listener. Possible values are: none as disabled, server_insert as auto-generated string and user_defined as cutom string. (Default: none).
    port float
    Port opened on the LB Listener to receive requests, range: 1-65535.
    protocol str
    LB Listener protocol. Possible values: http, https if listen_type is request_proxy, tcp and udp if listen_type is packets_transmit.
    status str
    LB Listener status. Possible values are: allNormal for all resource functioning well, partNormal for partial resource functioning well and allException for all resource functioning exceptional.
    domain String
    Health check domain checking.
    healthCheckType String
    Health check method. Possible values are port as port checking and path as http checking.
    id String
    The ID of LB Listener.
    idleTimeout Number
    Amount of time in seconds to wait for the response for in between two sessions if listen_type is request_proxy, range: 0-86400. Amount of time in seconds to wait for one session if listen_type is packets_transmit, range: 60-900. The session will be closed as soon as no response if it is 0.
    listenType String
    The type of LB Listener. Possible values are request_proxy and packets_transmit.
    method String
    The load balancer method in which the listener is. Possible values are: roundrobin, source, consistent_hash, source_port , consistent_hash_port, weight_roundrobin and leastconn.

    • The consistent_hash, source_port , consistent_hash_port, roundrobin, source and weight_roundrobin are valid if listen_type is packets_transmit.
    • The rundrobin, source and weight_roundrobin and leastconn are vaild if listen_type is request_proxy.
    name String
    The name of LB Listener.
    path String
    Health check path checking.
    persistence String
    Indicate whether the persistence session is enabled, it is invaild if persistence_type is none, an auto-generated string will be exported if persistence_type is server_insert, a custom string will be exported if persistence_type is user_defined.
    persistenceType String
    The type of session persistence of LB Listener. Possible values are: none as disabled, server_insert as auto-generated string and user_defined as cutom string. (Default: none).
    port Number
    Port opened on the LB Listener to receive requests, range: 1-65535.
    protocol String
    LB Listener protocol. Possible values: http, https if listen_type is request_proxy, tcp and udp if listen_type is packets_transmit.
    status String
    LB Listener status. Possible values are: allNormal for all resource functioning well, partNormal for partial resource functioning well and allException for all resource functioning exceptional.

    Package Details

    Repository
    ucloud ucloud/terraform-provider-ucloud
    License
    Notes
    This Pulumi package is based on the ucloud Terraform Provider.
    ucloud logo
    ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud