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/v3/go/azure/lb"
    "github.com/pulumi/pulumi/sdk/v2/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
    })
}
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);

Using GetLB

function getLB(args: GetLBArgs, opts?: InvokeOptions): Promise<GetLBResult>
function  get_lb(name=None, resource_group_name=None, opts=None)
func GetLB(ctx *Context, args *GetLBArgs, opts ...InvokeOption) (*GetLBResult, error)
public static class GetLB {
    public static Task<GetLBResult> InvokeAsync(GetLBArgs args, InvokeOptions? opts = null)
}

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 str

Specifies the name of the Load Balancer.

resource_group_name str

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

GetLB Result

The following output properties are available:

FrontendIpConfigurations List<GetLBFrontendIpConfiguration>

(Optional) 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

(Optional) 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 GetLBFrontendIpConfiguration[]

(Optional) 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 List[GetLBFrontendIpConfiguration]

(Optional) 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 List[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 Dict[str, str]

A mapping of tags assigned to the resource.

Supporting Types

GetLBFrontendIpConfiguration

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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 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.

privateIpAddressAllocation str

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

privateIpAddressVersion str

The Private IP Address Version, either IPv4 or IPv6.

private_ip_address str

Private IP Address to assign to the Load Balancer.

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 List[str]

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.