gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core
gcore.getLoadbalancerv2
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const project = gcore.getProject({
name: "Default",
});
const region = gcore.getRegion({
name: "Luxembourg-2",
});
const lb = Promise.all([region, project]).then(([region, project]) => gcore.getLoadbalancerv2({
regionId: region.id,
projectId: project.id,
name: "test-lb",
}));
export const view = lb;
export const lbIp = lb.then(lb => lb.vipAddress);
import pulumi
import pulumi_gcore as gcore
project = gcore.get_project(name="Default")
region = gcore.get_region(name="Luxembourg-2")
lb = gcore.get_loadbalancerv2(region_id=region.id,
project_id=project.id,
name="test-lb")
pulumi.export("view", lb)
pulumi.export("lbIp", lb.vip_address)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
project, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
Name: "Default",
}, nil)
if err != nil {
return err
}
region, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
Name: "Luxembourg-2",
}, nil)
if err != nil {
return err
}
lb, err := gcore.LookupLoadbalancerv2(ctx, &gcore.LookupLoadbalancerv2Args{
RegionId: pulumi.Float64Ref(region.Id),
ProjectId: pulumi.Float64Ref(project.Id),
Name: "test-lb",
}, nil)
if err != nil {
return err
}
ctx.Export("view", lb)
ctx.Export("lbIp", lb.VipAddress)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var project = Gcore.GetProject.Invoke(new()
{
Name = "Default",
});
var region = Gcore.GetRegion.Invoke(new()
{
Name = "Luxembourg-2",
});
var lb = Gcore.GetLoadbalancerv2.Invoke(new()
{
RegionId = region.Apply(getRegionResult => getRegionResult.Id),
ProjectId = project.Apply(getProjectResult => getProjectResult.Id),
Name = "test-lb",
});
return new Dictionary<string, object?>
{
["view"] = lb,
["lbIp"] = lb.Apply(getLoadbalancerv2Result => getLoadbalancerv2Result.VipAddress),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.GcoreFunctions;
import com.pulumi.gcore.inputs.GetProjectArgs;
import com.pulumi.gcore.inputs.GetRegionArgs;
import com.pulumi.gcore.inputs.GetLoadbalancerv2Args;
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 project = GcoreFunctions.getProject(GetProjectArgs.builder()
.name("Default")
.build());
final var region = GcoreFunctions.getRegion(GetRegionArgs.builder()
.name("Luxembourg-2")
.build());
final var lb = GcoreFunctions.getLoadbalancerv2(GetLoadbalancerv2Args.builder()
.regionId(region.applyValue(getRegionResult -> getRegionResult.id()))
.projectId(project.applyValue(getProjectResult -> getProjectResult.id()))
.name("test-lb")
.build());
ctx.export("view", lb.applyValue(getLoadbalancerv2Result -> getLoadbalancerv2Result));
ctx.export("lbIp", lb.applyValue(getLoadbalancerv2Result -> getLoadbalancerv2Result.vipAddress()));
}
}
variables:
project:
fn::invoke:
function: gcore:getProject
arguments:
name: Default
region:
fn::invoke:
function: gcore:getRegion
arguments:
name: Luxembourg-2
lb:
fn::invoke:
function: gcore:getLoadbalancerv2
arguments:
regionId: ${region.id}
projectId: ${project.id}
name: test-lb
outputs:
view: ${lb}
lbIp: ${lb.vipAddress}
Using getLoadbalancerv2
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 getLoadbalancerv2(args: GetLoadbalancerv2Args, opts?: InvokeOptions): Promise<GetLoadbalancerv2Result>
function getLoadbalancerv2Output(args: GetLoadbalancerv2OutputArgs, opts?: InvokeOptions): Output<GetLoadbalancerv2Result>
def get_loadbalancerv2(id: Optional[str] = None,
metadata_k: Optional[str] = None,
metadata_kv: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
vip_ip_family: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLoadbalancerv2Result
def get_loadbalancerv2_output(id: Optional[pulumi.Input[str]] = None,
metadata_k: Optional[pulumi.Input[str]] = None,
metadata_kv: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[float]] = None,
project_name: Optional[pulumi.Input[str]] = None,
region_id: Optional[pulumi.Input[float]] = None,
region_name: Optional[pulumi.Input[str]] = None,
vip_ip_family: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetLoadbalancerv2Result]
func LookupLoadbalancerv2(ctx *Context, args *LookupLoadbalancerv2Args, opts ...InvokeOption) (*LookupLoadbalancerv2Result, error)
func LookupLoadbalancerv2Output(ctx *Context, args *LookupLoadbalancerv2OutputArgs, opts ...InvokeOption) LookupLoadbalancerv2ResultOutput
> Note: This function is named LookupLoadbalancerv2
in the Go SDK.
public static class GetLoadbalancerv2
{
public static Task<GetLoadbalancerv2Result> InvokeAsync(GetLoadbalancerv2Args args, InvokeOptions? opts = null)
public static Output<GetLoadbalancerv2Result> Invoke(GetLoadbalancerv2InvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLoadbalancerv2Result> getLoadbalancerv2(GetLoadbalancerv2Args args, InvokeOptions options)
public static Output<GetLoadbalancerv2Result> getLoadbalancerv2(GetLoadbalancerv2Args args, InvokeOptions options)
fn::invoke:
function: gcore:index/getLoadbalancerv2:getLoadbalancerv2
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Name of the load balancer.
- Id string
- The ID of this resource.
- Metadata
K string - Metadata string of the load balancer.
- Metadata
Kv Dictionary<string, string> - Metadata map of the load balancer.
- Project
Id double - ID of the project in which load balancer was created.
- Project
Name string - Name of the project in which load balancer was created.
- Region
Id double - ID of the region in which load balancer was created.
- Region
Name string - Name of the region in which load balancer was created.
- Vip
Ip stringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- Name string
- Name of the load balancer.
- Id string
- The ID of this resource.
- Metadata
K string - Metadata string of the load balancer.
- Metadata
Kv map[string]string - Metadata map of the load balancer.
- Project
Id float64 - ID of the project in which load balancer was created.
- Project
Name string - Name of the project in which load balancer was created.
- Region
Id float64 - ID of the region in which load balancer was created.
- Region
Name string - Name of the region in which load balancer was created.
- Vip
Ip stringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- name String
- Name of the load balancer.
- id String
- The ID of this resource.
- metadata
K String - Metadata string of the load balancer.
- metadata
Kv Map<String,String> - Metadata map of the load balancer.
- project
Id Double - ID of the project in which load balancer was created.
- project
Name String - Name of the project in which load balancer was created.
- region
Id Double - ID of the region in which load balancer was created.
- region
Name String - Name of the region in which load balancer was created.
- vip
Ip StringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- name string
- Name of the load balancer.
- id string
- The ID of this resource.
- metadata
K string - Metadata string of the load balancer.
- metadata
Kv {[key: string]: string} - Metadata map of the load balancer.
- project
Id number - ID of the project in which load balancer was created.
- project
Name string - Name of the project in which load balancer was created.
- region
Id number - ID of the region in which load balancer was created.
- region
Name string - Name of the region in which load balancer was created.
- vip
Ip stringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- name str
- Name of the load balancer.
- id str
- The ID of this resource.
- metadata_
k str - Metadata string of the load balancer.
- metadata_
kv Mapping[str, str] - Metadata map of the load balancer.
- project_
id float - ID of the project in which load balancer was created.
- project_
name str - Name of the project in which load balancer was created.
- region_
id float - ID of the region in which load balancer was created.
- region_
name str - Name of the region in which load balancer was created.
- vip_
ip_ strfamily - Available values are 'ipv4', 'ipv6', 'dual'
- name String
- Name of the load balancer.
- id String
- The ID of this resource.
- metadata
K String - Metadata string of the load balancer.
- metadata
Kv Map<String> - Metadata map of the load balancer.
- project
Id Number - ID of the project in which load balancer was created.
- project
Name String - Name of the project in which load balancer was created.
- region
Id Number - ID of the region in which load balancer was created.
- region
Name String - Name of the region in which load balancer was created.
- vip
Ip StringFamily - Available values are 'ipv4', 'ipv6', 'dual'
getLoadbalancerv2 Result
The following output properties are available:
- Additional
Vips List<GetLoadbalancerv2Additional Vip> - Load Balancer additional VIPs
- Id string
- The ID of this resource.
- Metadata
Read List<GetOnlies Loadbalancerv2Metadata Read Only> - List of metadata items.
- Name string
- Name of the load balancer.
- Preferred
Connectivity string - Available values are 'L2', 'L3'
- Vip
Address string - Load balancer IP address.
- Vip
Ip stringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- Vip
Port stringId - Load balancer Port ID.
- Vrrp
Ips List<GetLoadbalancerv2Vrrp Ip> - Metadata
K string - Metadata string of the load balancer.
- Metadata
Kv Dictionary<string, string> - Metadata map of the load balancer.
- Project
Id double - ID of the project in which load balancer was created.
- Project
Name string - Name of the project in which load balancer was created.
- Region
Id double - ID of the region in which load balancer was created.
- Region
Name string - Name of the region in which load balancer was created.
- Additional
Vips []GetLoadbalancerv2Additional Vip - Load Balancer additional VIPs
- Id string
- The ID of this resource.
- Metadata
Read []GetOnlies Loadbalancerv2Metadata Read Only - List of metadata items.
- Name string
- Name of the load balancer.
- Preferred
Connectivity string - Available values are 'L2', 'L3'
- Vip
Address string - Load balancer IP address.
- Vip
Ip stringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- Vip
Port stringId - Load balancer Port ID.
- Vrrp
Ips []GetLoadbalancerv2Vrrp Ip - Metadata
K string - Metadata string of the load balancer.
- Metadata
Kv map[string]string - Metadata map of the load balancer.
- Project
Id float64 - ID of the project in which load balancer was created.
- Project
Name string - Name of the project in which load balancer was created.
- Region
Id float64 - ID of the region in which load balancer was created.
- Region
Name string - Name of the region in which load balancer was created.
- additional
Vips List<GetLoadbalancerv2Additional Vip> - Load Balancer additional VIPs
- id String
- The ID of this resource.
- metadata
Read List<GetOnlies Loadbalancerv2Metadata Read Only> - List of metadata items.
- name String
- Name of the load balancer.
- preferred
Connectivity String - Available values are 'L2', 'L3'
- vip
Address String - Load balancer IP address.
- vip
Ip StringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- vip
Port StringId - Load balancer Port ID.
- vrrp
Ips List<GetLoadbalancerv2Vrrp Ip> - metadata
K String - Metadata string of the load balancer.
- metadata
Kv Map<String,String> - Metadata map of the load balancer.
- project
Id Double - ID of the project in which load balancer was created.
- project
Name String - Name of the project in which load balancer was created.
- region
Id Double - ID of the region in which load balancer was created.
- region
Name String - Name of the region in which load balancer was created.
- additional
Vips GetLoadbalancerv2Additional Vip[] - Load Balancer additional VIPs
- id string
- The ID of this resource.
- metadata
Read GetOnlies Loadbalancerv2Metadata Read Only[] - List of metadata items.
- name string
- Name of the load balancer.
- preferred
Connectivity string - Available values are 'L2', 'L3'
- vip
Address string - Load balancer IP address.
- vip
Ip stringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- vip
Port stringId - Load balancer Port ID.
- vrrp
Ips GetLoadbalancerv2Vrrp Ip[] - metadata
K string - Metadata string of the load balancer.
- metadata
Kv {[key: string]: string} - Metadata map of the load balancer.
- project
Id number - ID of the project in which load balancer was created.
- project
Name string - Name of the project in which load balancer was created.
- region
Id number - ID of the region in which load balancer was created.
- region
Name string - Name of the region in which load balancer was created.
- additional_
vips Sequence[GetLoadbalancerv2Additional Vip] - Load Balancer additional VIPs
- id str
- The ID of this resource.
- metadata_
read_ Sequence[Getonlies Loadbalancerv2Metadata Read Only] - List of metadata items.
- name str
- Name of the load balancer.
- preferred_
connectivity str - Available values are 'L2', 'L3'
- vip_
address str - Load balancer IP address.
- vip_
ip_ strfamily - Available values are 'ipv4', 'ipv6', 'dual'
- vip_
port_ strid - Load balancer Port ID.
- vrrp_
ips Sequence[GetLoadbalancerv2Vrrp Ip] - metadata_
k str - Metadata string of the load balancer.
- metadata_
kv Mapping[str, str] - Metadata map of the load balancer.
- project_
id float - ID of the project in which load balancer was created.
- project_
name str - Name of the project in which load balancer was created.
- region_
id float - ID of the region in which load balancer was created.
- region_
name str - Name of the region in which load balancer was created.
- additional
Vips List<Property Map> - Load Balancer additional VIPs
- id String
- The ID of this resource.
- metadata
Read List<Property Map>Onlies - List of metadata items.
- name String
- Name of the load balancer.
- preferred
Connectivity String - Available values are 'L2', 'L3'
- vip
Address String - Load balancer IP address.
- vip
Ip StringFamily - Available values are 'ipv4', 'ipv6', 'dual'
- vip
Port StringId - Load balancer Port ID.
- vrrp
Ips List<Property Map> - metadata
K String - Metadata string of the load balancer.
- metadata
Kv Map<String> - Metadata map of the load balancer.
- project
Id Number - ID of the project in which load balancer was created.
- project
Name String - Name of the project in which load balancer was created.
- region
Id Number - ID of the region in which load balancer was created.
- region
Name String - Name of the region in which load balancer was created.
Supporting Types
GetLoadbalancerv2AdditionalVip
- ip_
address str - subnet_
id str
GetLoadbalancerv2MetadataReadOnly
GetLoadbalancerv2VrrpIp
- ip_
address str - subnet_
id str
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.