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

ucloud.getLbs

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 resources according to their Load Balancer ID, VPC ID and Subnet ID.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ucloud from "@pulumi/ucloud";
    
    const example = ucloud.getLbs({});
    export const first = example.then(example => example.lbs?.[0]?.id);
    
    import pulumi
    import pulumi_ucloud as ucloud
    
    example = ucloud.get_lbs()
    pulumi.export("first", example.lbs[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.GetLbs(ctx, &ucloud.GetLbsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("first", example.Lbs[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ucloud = Pulumi.Ucloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ucloud.GetLbs.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["first"] = example.Apply(getLbsResult => getLbsResult.Lbs[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.GetLbsArgs;
    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.getLbs();
    
            ctx.export("first", example.applyValue(getLbsResult -> getLbsResult.lbs()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ucloud:getLbs
          arguments: {}
    outputs:
      first: ${example.lbs[0].id}
    

    Using getLbs

    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 getLbs(args: GetLbsArgs, opts?: InvokeOptions): Promise<GetLbsResult>
    function getLbsOutput(args: GetLbsOutputArgs, opts?: InvokeOptions): Output<GetLbsResult>
    def get_lbs(id: Optional[str] = None,
                ids: Optional[Sequence[str]] = None,
                name_regex: Optional[str] = None,
                output_file: Optional[str] = None,
                subnet_id: Optional[str] = None,
                vpc_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetLbsResult
    def get_lbs_output(id: Optional[pulumi.Input[str]] = None,
                ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                name_regex: Optional[pulumi.Input[str]] = None,
                output_file: Optional[pulumi.Input[str]] = None,
                subnet_id: Optional[pulumi.Input[str]] = None,
                vpc_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetLbsResult]
    func GetLbs(ctx *Context, args *GetLbsArgs, opts ...InvokeOption) (*GetLbsResult, error)
    func GetLbsOutput(ctx *Context, args *GetLbsOutputArgs, opts ...InvokeOption) GetLbsResultOutput

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

    public static class GetLbs 
    {
        public static Task<GetLbsResult> InvokeAsync(GetLbsArgs args, InvokeOptions? opts = null)
        public static Output<GetLbsResult> Invoke(GetLbsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLbsResult> getLbs(GetLbsArgs args, InvokeOptions options)
    public static Output<GetLbsResult> getLbs(GetLbsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ucloud:index/getLbs:getLbs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of Load Balancer.
    Ids List<string>
    A list of Load Balancer IDs, all the LBs belong to this region will be retrieved if the ID is [].
    NameRegex string
    A regex string to filter resulting lbs by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SubnetId string
    The ID of subnet that intrant load balancer belongs to.
    VpcId string
    The ID of the VPC linked to the Load Balancers.
    Id string
    The ID of Load Balancer.
    Ids []string
    A list of Load Balancer IDs, all the LBs belong to this region will be retrieved if the ID is [].
    NameRegex string
    A regex string to filter resulting lbs by name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SubnetId string
    The ID of subnet that intrant load balancer belongs to.
    VpcId string
    The ID of the VPC linked to the Load Balancers.
    id String
    The ID of Load Balancer.
    ids List<String>
    A list of Load Balancer IDs, all the LBs belong to this region will be retrieved if the ID is [].
    nameRegex String
    A regex string to filter resulting lbs by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    subnetId String
    The ID of subnet that intrant load balancer belongs to.
    vpcId String
    The ID of the VPC linked to the Load Balancers.
    id string
    The ID of Load Balancer.
    ids string[]
    A list of Load Balancer IDs, all the LBs belong to this region will be retrieved if the ID is [].
    nameRegex string
    A regex string to filter resulting lbs by name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    subnetId string
    The ID of subnet that intrant load balancer belongs to.
    vpcId string
    The ID of the VPC linked to the Load Balancers.
    id str
    The ID of Load Balancer.
    ids Sequence[str]
    A list of Load Balancer IDs, all the LBs belong to this region will be retrieved if the ID is [].
    name_regex str
    A regex string to filter resulting lbs by name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    subnet_id str
    The ID of subnet that intrant load balancer belongs to.
    vpc_id str
    The ID of the VPC linked to the Load Balancers.
    id String
    The ID of Load Balancer.
    ids List<String>
    A list of Load Balancer IDs, all the LBs belong to this region will be retrieved if the ID is [].
    nameRegex String
    A regex string to filter resulting lbs by name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    subnetId String
    The ID of subnet that intrant load balancer belongs to.
    vpcId String
    The ID of the VPC linked to the Load Balancers.

    getLbs Result

    The following output properties are available:

    Id string
    The ID of Load Balancer.
    Ids List<string>
    Lbs List<GetLbsLb>
    It is a nested type which documented below.
    SubnetId string
    (Optional) The ID of subnet that intrant load balancer belongs to.
    TotalCount double
    Total number of Load Balancers that satisfy the condition.
    VpcId string
    The ID of the VPC linked to the Load Balancers.
    NameRegex string
    OutputFile string
    Id string
    The ID of Load Balancer.
    Ids []string
    Lbs []GetLbsLb
    It is a nested type which documented below.
    SubnetId string
    (Optional) The ID of subnet that intrant load balancer belongs to.
    TotalCount float64
    Total number of Load Balancers that satisfy the condition.
    VpcId string
    The ID of the VPC linked to the Load Balancers.
    NameRegex string
    OutputFile string
    id String
    The ID of Load Balancer.
    ids List<String>
    lbs List<GetLbsLb>
    It is a nested type which documented below.
    subnetId String
    (Optional) The ID of subnet that intrant load balancer belongs to.
    totalCount Double
    Total number of Load Balancers that satisfy the condition.
    vpcId String
    The ID of the VPC linked to the Load Balancers.
    nameRegex String
    outputFile String
    id string
    The ID of Load Balancer.
    ids string[]
    lbs GetLbsLb[]
    It is a nested type which documented below.
    subnetId string
    (Optional) The ID of subnet that intrant load balancer belongs to.
    totalCount number
    Total number of Load Balancers that satisfy the condition.
    vpcId string
    The ID of the VPC linked to the Load Balancers.
    nameRegex string
    outputFile string
    id str
    The ID of Load Balancer.
    ids Sequence[str]
    lbs Sequence[GetLbsLb]
    It is a nested type which documented below.
    subnet_id str
    (Optional) The ID of subnet that intrant load balancer belongs to.
    total_count float
    Total number of Load Balancers that satisfy the condition.
    vpc_id str
    The ID of the VPC linked to the Load Balancers.
    name_regex str
    output_file str
    id String
    The ID of Load Balancer.
    ids List<String>
    lbs List<Property Map>
    It is a nested type which documented below.
    subnetId String
    (Optional) The ID of subnet that intrant load balancer belongs to.
    totalCount Number
    Total number of Load Balancers that satisfy the condition.
    vpcId String
    The ID of the VPC linked to the Load Balancers.
    nameRegex String
    outputFile String

    Supporting Types

    GetLbsLb

    CreateTime string
    The creation time of Load Balancer, formatted in RFC3339 time string.
    Id string
    The ID of Load Balancer.
    Internal bool
    Indicate whether the load balancer is intranet.
    IpSets List<GetLbsLbIpSet>
    Name string
    The name of Load Balancer.
    PrivateIp string
    The IP address of intranet IP.
    Remark string
    The remarks of Load Balancer.
    SubnetId string
    The ID of subnet that intrant load balancer belongs to.
    Tag string
    A tag assigned to Load Balancer.
    VpcId string
    The ID of the VPC linked to the Load Balancers.
    CreateTime string
    The creation time of Load Balancer, formatted in RFC3339 time string.
    Id string
    The ID of Load Balancer.
    Internal bool
    Indicate whether the load balancer is intranet.
    IpSets []GetLbsLbIpSet
    Name string
    The name of Load Balancer.
    PrivateIp string
    The IP address of intranet IP.
    Remark string
    The remarks of Load Balancer.
    SubnetId string
    The ID of subnet that intrant load balancer belongs to.
    Tag string
    A tag assigned to Load Balancer.
    VpcId string
    The ID of the VPC linked to the Load Balancers.
    createTime String
    The creation time of Load Balancer, formatted in RFC3339 time string.
    id String
    The ID of Load Balancer.
    internal Boolean
    Indicate whether the load balancer is intranet.
    ipSets List<GetLbsLbIpSet>
    name String
    The name of Load Balancer.
    privateIp String
    The IP address of intranet IP.
    remark String
    The remarks of Load Balancer.
    subnetId String
    The ID of subnet that intrant load balancer belongs to.
    tag String
    A tag assigned to Load Balancer.
    vpcId String
    The ID of the VPC linked to the Load Balancers.
    createTime string
    The creation time of Load Balancer, formatted in RFC3339 time string.
    id string
    The ID of Load Balancer.
    internal boolean
    Indicate whether the load balancer is intranet.
    ipSets GetLbsLbIpSet[]
    name string
    The name of Load Balancer.
    privateIp string
    The IP address of intranet IP.
    remark string
    The remarks of Load Balancer.
    subnetId string
    The ID of subnet that intrant load balancer belongs to.
    tag string
    A tag assigned to Load Balancer.
    vpcId string
    The ID of the VPC linked to the Load Balancers.
    create_time str
    The creation time of Load Balancer, formatted in RFC3339 time string.
    id str
    The ID of Load Balancer.
    internal bool
    Indicate whether the load balancer is intranet.
    ip_sets Sequence[GetLbsLbIpSet]
    name str
    The name of Load Balancer.
    private_ip str
    The IP address of intranet IP.
    remark str
    The remarks of Load Balancer.
    subnet_id str
    The ID of subnet that intrant load balancer belongs to.
    tag str
    A tag assigned to Load Balancer.
    vpc_id str
    The ID of the VPC linked to the Load Balancers.
    createTime String
    The creation time of Load Balancer, formatted in RFC3339 time string.
    id String
    The ID of Load Balancer.
    internal Boolean
    Indicate whether the load balancer is intranet.
    ipSets List<Property Map>
    name String
    The name of Load Balancer.
    privateIp String
    The IP address of intranet IP.
    remark String
    The remarks of Load Balancer.
    subnetId String
    The ID of subnet that intrant load balancer belongs to.
    tag String
    A tag assigned to Load Balancer.
    vpcId String
    The ID of the VPC linked to the Load Balancers.

    GetLbsLbIpSet

    InternetType string
    Type of Load Balancer routes.
    Ip string
    Load Balancer address.
    InternetType string
    Type of Load Balancer routes.
    Ip string
    Load Balancer address.
    internetType String
    Type of Load Balancer routes.
    ip String
    Load Balancer address.
    internetType string
    Type of Load Balancer routes.
    ip string
    Load Balancer address.
    internet_type str
    Type of Load Balancer routes.
    ip str
    Load Balancer address.
    internetType String
    Type of Load Balancer routes.
    ip String
    Load Balancer address.

    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