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 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);
Copy
import pulumi
import pulumi_ucloud as ucloud

example = ucloud.get_lbs()
pulumi.export("first", example.lbs[0].id)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ucloud:getLbs
      arguments: {}
outputs:
  first: ${example.lbs[0].id}
Copy

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>
Copy
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]
Copy
func GetLbs(ctx *Context, args *GetLbsArgs, opts ...InvokeOption) (*GetLbsResult, error)
func GetLbsOutput(ctx *Context, args *GetLbsOutputArgs, opts ...InvokeOption) GetLbsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetLbsResult> getLbs(GetLbsArgs args, InvokeOptions options)
public static Output<GetLbsResult> getLbs(GetLbsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ucloud:index/getLbs:getLbs
  arguments:
    # arguments dictionary
Copy

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

GetLbsLbIpSet

InternetType This property is required. string
Type of Load Balancer routes.
Ip This property is required. string
Load Balancer address.
InternetType This property is required. string
Type of Load Balancer routes.
Ip This property is required. string
Load Balancer address.
internetType This property is required. String
Type of Load Balancer routes.
ip This property is required. String
Load Balancer address.
internetType This property is required. string
Type of Load Balancer routes.
ip This property is required. string
Load Balancer address.
internet_type This property is required. str
Type of Load Balancer routes.
ip This property is required. str
Load Balancer address.
internetType This property is required. String
Type of Load Balancer routes.
ip This property is required. 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 1.39.1 published on Monday, Apr 14, 2025 by ucloud