Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.14.0 published on Thursday, Jul 28, 2022 by Pulumi

getLB

Use this data source to access information about an existing Load Balancer

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.Lb.GetLB.InvokeAsync(new Azure.Lb.GetLBArgs
        {
            Name = "example-lb",
            ResourceGroupName = "example-resources",
        }));
        this.LoadbalancerId = example.Apply(example => example.Id);
    }

    [Output("loadbalancerId")]
    public Output<string> LoadbalancerId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := lb.GetLB(ctx, &lb.GetLBArgs{
			Name:              "example-lb",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("loadbalancerId", example.Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.lb.LbFunctions;
import com.pulumi.azure.lb.inputs.GetLBArgs;
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 = LbFunctions.getLB(GetLBArgs.builder()
            .name("example-lb")
            .resourceGroupName("example-resources")
            .build());

        ctx.export("loadbalancerId", example.applyValue(getLBResult -> getLBResult.id()));
    }
}
import pulumi
import pulumi_azure as azure

example = azure.lb.get_lb(name="example-lb",
    resource_group_name="example-resources")
pulumi.export("loadbalancerId", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.lb.getLB({
    name: "example-lb",
    resourceGroupName: "example-resources",
});
export const loadbalancerId = example.then(example => example.id);
variables:
  example:
    Fn::Invoke:
      Function: azure:lb:getLB
      Arguments:
        name: example-lb
        resourceGroupName: example-resources
outputs:
  loadbalancerId: ${example.id}

Using getLB

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 getLB(args: GetLBArgs, opts?: InvokeOptions): Promise<GetLBResult>
function getLBOutput(args: GetLBOutputArgs, opts?: InvokeOptions): Output<GetLBResult>
def get_lb(name: Optional[str] = None,
           resource_group_name: Optional[str] = None,
           opts: Optional[InvokeOptions] = None) -> GetLBResult
def get_lb_output(name: Optional[pulumi.Input[str]] = None,
           resource_group_name: Optional[pulumi.Input[str]] = None,
           opts: Optional[InvokeOptions] = None) -> Output[GetLBResult]
func GetLB(ctx *Context, args *GetLBArgs, opts ...InvokeOption) (*GetLBResult, error)
func GetLBOutput(ctx *Context, args *GetLBOutputArgs, opts ...InvokeOption) GetLBResultOutput

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

public static class GetLB 
{
    public static Task<GetLBResult> InvokeAsync(GetLBArgs args, InvokeOptions? opts = null)
    public static Output<GetLBResult> Invoke(GetLBInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLBResult> getLB(GetLBArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: azure:lb/getLB:getLB
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

Specifies the name of the Load Balancer.

ResourceGroupName string

The name of the Resource Group in which the Load Balancer exists.

Name string

Specifies the name of the Load Balancer.

ResourceGroupName string

The name of the Resource Group in which the Load Balancer exists.

name String

Specifies the name of the Load Balancer.

resourceGroupName String

The name of the Resource Group in which the Load Balancer exists.

name string

Specifies the name of the Load Balancer.

resourceGroupName string

The name of the Resource Group in which the Load Balancer exists.

name str

Specifies the name of the Load Balancer.

resource_group_name str

The name of the Resource Group in which the Load Balancer exists.

name String

Specifies the name of the Load Balancer.

resourceGroupName String

The name of the Resource Group in which the Load Balancer exists.

getLB Result

The following output properties are available:

FrontendIpConfigurations List<Pulumi.Azure.Lb.Outputs.GetLBFrontendIpConfiguration>

A frontend_ip_configuration block as documented below.

Id string

The provider-assigned unique ID for this managed resource.

Location string

The Azure location where the Load Balancer exists.

Name string

The name of the Frontend IP Configuration.

PrivateIpAddress string

Private IP Address to assign to the Load Balancer.

PrivateIpAddresses List<string>

The list of private IP address assigned to the load balancer in frontend_ip_configuration blocks, if any.

ResourceGroupName string
Sku string

The SKU of the Load Balancer.

Tags Dictionary<string, string>

A mapping of tags assigned to the resource.

FrontendIpConfigurations []GetLBFrontendIpConfiguration

A frontend_ip_configuration block as documented below.

Id string

The provider-assigned unique ID for this managed resource.

Location string

The Azure location where the Load Balancer exists.

Name string

The name of the Frontend IP Configuration.

PrivateIpAddress string

Private IP Address to assign to the Load Balancer.

PrivateIpAddresses []string

The list of private IP address assigned to the load balancer in frontend_ip_configuration blocks, if any.

ResourceGroupName string
Sku string

The SKU of the Load Balancer.

Tags map[string]string

A mapping of tags assigned to the resource.

frontendIpConfigurations List<GetLBFrontendIpConfiguration>

A frontend_ip_configuration block as documented below.

id String

The provider-assigned unique ID for this managed resource.

location String

The Azure location where the Load Balancer exists.

name String

The name of the Frontend IP Configuration.

privateIpAddress String

Private IP Address to assign to the Load Balancer.

privateIpAddresses List<String>

The list of private IP address assigned to the load balancer in frontend_ip_configuration blocks, if any.

resourceGroupName String
sku String

The SKU of the Load Balancer.

tags Map<String,String>

A mapping of tags assigned to the resource.

frontendIpConfigurations GetLBFrontendIpConfiguration[]

A frontend_ip_configuration block as documented below.

id string

The provider-assigned unique ID for this managed resource.

location string

The Azure location where the Load Balancer exists.

name string

The name of the Frontend IP Configuration.

privateIpAddress string

Private IP Address to assign to the Load Balancer.

privateIpAddresses string[]

The list of private IP address assigned to the load balancer in frontend_ip_configuration blocks, if any.

resourceGroupName string
sku string

The SKU of the Load Balancer.

tags {[key: string]: string}

A mapping of tags assigned to the resource.

frontend_ip_configurations Sequence[GetLBFrontendIpConfiguration]

A frontend_ip_configuration block as documented below.

id str

The provider-assigned unique ID for this managed resource.

location str

The Azure location where the Load Balancer exists.

name str

The name of the Frontend IP Configuration.

private_ip_address str

Private IP Address to assign to the Load Balancer.

private_ip_addresses Sequence[str]

The list of private IP address assigned to the load balancer in frontend_ip_configuration blocks, if any.

resource_group_name str
sku str

The SKU of the Load Balancer.

tags Mapping[str, str]

A mapping of tags assigned to the resource.

frontendIpConfigurations List<Property Map>

A frontend_ip_configuration block as documented below.

id String

The provider-assigned unique ID for this managed resource.

location String

The Azure location where the Load Balancer exists.

name String

The name of the Frontend IP Configuration.

privateIpAddress String

Private IP Address to assign to the Load Balancer.

privateIpAddresses List<String>

The list of private IP address assigned to the load balancer in frontend_ip_configuration blocks, if any.

resourceGroupName String
sku String

The SKU of the Load Balancer.

tags Map<String>

A mapping of tags assigned to the resource.

Supporting Types

GetLBFrontendIpConfiguration

Id string

The id of the Frontend IP Configuration.

Name string

Specifies the name of the Load Balancer.

PrivateIpAddress string

Private IP Address to assign to the Load Balancer.

PrivateIpAddressAllocation string

The allocation method for the Private IP Address used by this Load Balancer.

PrivateIpAddressVersion string

The Private IP Address Version, either IPv4 or IPv6.

PublicIpAddressId string

The ID of a Public IP Address which is associated with this Load Balancer.

SubnetId string

The ID of the Subnet which is associated with the IP Configuration.

Zones List<string>

A list of Availability Zones which the Load Balancer's IP Addresses should be created in.

Id string

The id of the Frontend IP Configuration.

Name string

Specifies the name of the Load Balancer.

PrivateIpAddress string

Private IP Address to assign to the Load Balancer.

PrivateIpAddressAllocation string

The allocation method for the Private IP Address used by this Load Balancer.

PrivateIpAddressVersion string

The Private IP Address Version, either IPv4 or IPv6.

PublicIpAddressId string

The ID of a Public IP Address which is associated with this Load Balancer.

SubnetId string

The ID of the Subnet which is associated with the IP Configuration.

Zones []string

A list of Availability Zones which the Load Balancer's IP Addresses should be created in.

id String

The id of the Frontend IP Configuration.

name String

Specifies the name of the Load Balancer.

privateIpAddress String

Private IP Address to assign to the Load Balancer.

privateIpAddressAllocation String

The allocation method for the Private IP Address used by this Load Balancer.

privateIpAddressVersion String

The Private IP Address Version, either IPv4 or IPv6.

publicIpAddressId String

The ID of a Public IP Address which is associated with this Load Balancer.

subnetId String

The ID of the Subnet which is associated with the IP Configuration.

zones List<String>

A list of Availability Zones which the Load Balancer's IP Addresses should be created in.

id string

The id of the Frontend IP Configuration.

name string

Specifies the name of the Load Balancer.

privateIpAddress string

Private IP Address to assign to the Load Balancer.

privateIpAddressAllocation string

The allocation method for the Private IP Address used by this Load Balancer.

privateIpAddressVersion string

The Private IP Address Version, either IPv4 or IPv6.

publicIpAddressId string

The ID of a Public IP Address which is associated with this Load Balancer.

subnetId string

The ID of the Subnet which is associated with the IP Configuration.

zones string[]

A list of Availability Zones which the Load Balancer's IP Addresses should be created in.

id str

The id of the Frontend IP Configuration.

name str

Specifies the name of the Load Balancer.

private_ip_address str

Private IP Address to assign to the Load Balancer.

private_ip_address_allocation str

The allocation method for the Private IP Address used by this Load Balancer.

private_ip_address_version str

The Private IP Address Version, either IPv4 or IPv6.

public_ip_address_id str

The ID of a Public IP Address which is associated with this Load Balancer.

subnet_id str

The ID of the Subnet which is associated with the IP Configuration.

zones Sequence[str]

A list of Availability Zones which the Load Balancer's IP Addresses should be created in.

id String

The id of the Frontend IP Configuration.

name String

Specifies the name of the Load Balancer.

privateIpAddress String

Private IP Address to assign to the Load Balancer.

privateIpAddressAllocation String

The allocation method for the Private IP Address used by this Load Balancer.

privateIpAddressVersion String

The Private IP Address Version, either IPv4 or IPv6.

publicIpAddressId String

The ID of a Public IP Address which is associated with this Load Balancer.

subnetId String

The ID of the Subnet which is associated with the IP Configuration.

zones List<String>

A list of Availability Zones which the Load Balancer's IP Addresses should be created in.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.