ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud
ucloud.getLbs
Explore with Pulumi AI
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
[]
. - Name
Regex string - A regex string to filter resulting lbs by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Subnet
Id string - The ID of subnet that intrant load balancer belongs to.
- Vpc
Id 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
[]
. - Name
Regex string - A regex string to filter resulting lbs by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Subnet
Id string - The ID of subnet that intrant load balancer belongs to.
- Vpc
Id 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
[]
. - name
Regex String - A regex string to filter resulting lbs by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - subnet
Id String - The ID of subnet that intrant load balancer belongs to.
- vpc
Id 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
[]
. - name
Regex string - A regex string to filter resulting lbs by name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - subnet
Id string - The ID of subnet that intrant load balancer belongs to.
- vpc
Id 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
[]
. - name
Regex String - A regex string to filter resulting lbs by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - subnet
Id String - The ID of subnet that intrant load balancer belongs to.
- vpc
Id 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<Get
Lbs Lb> - It is a nested type which documented below.
- Subnet
Id string - (Optional) The ID of subnet that intrant load balancer belongs to.
- Total
Count double - Total number of Load Balancers that satisfy the condition.
- Vpc
Id string - The ID of the VPC linked to the Load Balancers.
- Name
Regex string - Output
File string
- Id string
- The ID of Load Balancer.
- Ids []string
- Lbs
[]Get
Lbs Lb - It is a nested type which documented below.
- Subnet
Id string - (Optional) The ID of subnet that intrant load balancer belongs to.
- Total
Count float64 - Total number of Load Balancers that satisfy the condition.
- Vpc
Id string - The ID of the VPC linked to the Load Balancers.
- Name
Regex string - Output
File string
- id String
- The ID of Load Balancer.
- ids List<String>
- lbs
List<Get
Lbs Lb> - It is a nested type which documented below.
- subnet
Id String - (Optional) The ID of subnet that intrant load balancer belongs to.
- total
Count Double - Total number of Load Balancers that satisfy the condition.
- vpc
Id String - The ID of the VPC linked to the Load Balancers.
- name
Regex String - output
File String
- id string
- The ID of Load Balancer.
- ids string[]
- lbs
Get
Lbs Lb[] - It is a nested type which documented below.
- subnet
Id string - (Optional) The ID of subnet that intrant load balancer belongs to.
- total
Count number - Total number of Load Balancers that satisfy the condition.
- vpc
Id string - The ID of the VPC linked to the Load Balancers.
- name
Regex string - output
File string
- id str
- The ID of Load Balancer.
- ids Sequence[str]
- lbs
Sequence[Get
Lbs Lb] - 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.
- subnet
Id String - (Optional) The ID of subnet that intrant load balancer belongs to.
- total
Count Number - Total number of Load Balancers that satisfy the condition.
- vpc
Id String - The ID of the VPC linked to the Load Balancers.
- name
Regex String - output
File String
Supporting Types
GetLbsLb
- Create
Time 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.
- Ip
Sets List<GetLbs Lb Ip Set> - Name string
- The name of Load Balancer.
- Private
Ip string - The IP address of intranet IP.
- Remark string
- The remarks of Load Balancer.
- Subnet
Id string - The ID of subnet that intrant load balancer belongs to.
- Tag string
- A tag assigned to Load Balancer.
- Vpc
Id string - The ID of the VPC linked to the Load Balancers.
- Create
Time 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.
- Ip
Sets []GetLbs Lb Ip Set - Name string
- The name of Load Balancer.
- Private
Ip string - The IP address of intranet IP.
- Remark string
- The remarks of Load Balancer.
- Subnet
Id string - The ID of subnet that intrant load balancer belongs to.
- Tag string
- A tag assigned to Load Balancer.
- Vpc
Id string - The ID of the VPC linked to the Load Balancers.
- create
Time 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.
- ip
Sets List<GetLbs Lb Ip Set> - name String
- The name of Load Balancer.
- private
Ip String - The IP address of intranet IP.
- remark String
- The remarks of Load Balancer.
- subnet
Id String - The ID of subnet that intrant load balancer belongs to.
- tag String
- A tag assigned to Load Balancer.
- vpc
Id String - The ID of the VPC linked to the Load Balancers.
- create
Time 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.
- ip
Sets GetLbs Lb Ip Set[] - name string
- The name of Load Balancer.
- private
Ip string - The IP address of intranet IP.
- remark string
- The remarks of Load Balancer.
- subnet
Id string - The ID of subnet that intrant load balancer belongs to.
- tag string
- A tag assigned to Load Balancer.
- vpc
Id 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[GetLbs Lb Ip Set] - 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.
- create
Time 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.
- ip
Sets List<Property Map> - name String
- The name of Load Balancer.
- private
Ip String - The IP address of intranet IP.
- remark String
- The remarks of Load Balancer.
- subnet
Id String - The ID of subnet that intrant load balancer belongs to.
- tag String
- A tag assigned to Load Balancer.
- vpc
Id String - The ID of the VPC linked to the Load Balancers.
GetLbsLbIpSet
- Internet
Type string - Type of Load Balancer routes.
- Ip string
- Load Balancer address.
- Internet
Type string - Type of Load Balancer routes.
- Ip string
- Load Balancer address.
- internet
Type String - Type of Load Balancer routes.
- ip String
- Load Balancer address.
- internet
Type string - Type of Load Balancer routes.
- ip string
- Load Balancer address.
- internet_
type str - Type of Load Balancer routes.
- ip str
- Load Balancer address.
- internet
Type 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.