Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.6.0 published on Friday, May 20, 2022 by Pulumi

getLBRule

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

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

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

    [Output("lbRuleId")]
    public Output<string> LbRuleId { 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 {
		exampleLB, err := lb.GetLB(ctx, &lb.GetLBArgs{
			Name:              "example-lb",
			ResourceGroupName: "example-resources",
		}, nil)
		if err != nil {
			return err
		}
		exampleLBRule, err := lb.GetLBRule(ctx, &lb.GetLBRuleArgs{
			Name:              "first",
			ResourceGroupName: "example-resources",
			LoadbalancerId:    exampleLB.Id,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("lbRuleId", exampleLBRule.Id)
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var exampleLB = Output.of(LbFunctions.getLB(GetLBArgs.builder()
            .name("example-lb")
            .resourceGroupName("example-resources")
            .build()));

        final var exampleLBRule = Output.of(LbFunctions.getLBRule(GetLBRuleArgs.builder()
            .name("first")
            .resourceGroupName("example-resources")
            .loadbalancerId(exampleLB.apply(getLBResult -> getLBResult.getId()))
            .build()));

        ctx.export("lbRuleId", exampleLBRule.apply(getLBRuleResult -> getLBRuleResult.getId()));
        }
}
import pulumi
import pulumi_azure as azure

example_lb = azure.lb.get_lb(name="example-lb",
    resource_group_name="example-resources")
example_lb_rule = azure.lb.get_lb_rule(name="first",
    resource_group_name="example-resources",
    loadbalancer_id=example_lb.id)
pulumi.export("lbRuleId", example_lb_rule.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

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

Using getLBRule

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 getLBRule(args: GetLBRuleArgs, opts?: InvokeOptions): Promise<GetLBRuleResult>
function getLBRuleOutput(args: GetLBRuleOutputArgs, opts?: InvokeOptions): Output<GetLBRuleResult>
def get_lb_rule(loadbalancer_id: Optional[str] = None,
                name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetLBRuleResult
def get_lb_rule_output(loadbalancer_id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetLBRuleResult]
func GetLBRule(ctx *Context, args *GetLBRuleArgs, opts ...InvokeOption) (*GetLBRuleResult, error)
func GetLBRuleOutput(ctx *Context, args *GetLBRuleOutputArgs, opts ...InvokeOption) GetLBRuleResultOutput

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

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

The following arguments are supported:

LoadbalancerId string

The ID of the Load Balancer Rule.

Name string

The name of this Load Balancer Rule.

LoadbalancerId string

The ID of the Load Balancer Rule.

Name string

The name of this Load Balancer Rule.

loadbalancerId String

The ID of the Load Balancer Rule.

name String

The name of this Load Balancer Rule.

loadbalancerId string

The ID of the Load Balancer Rule.

name string

The name of this Load Balancer Rule.

loadbalancer_id str

The ID of the Load Balancer Rule.

name str

The name of this Load Balancer Rule.

loadbalancerId String

The ID of the Load Balancer Rule.

name String

The name of this Load Balancer Rule.

getLBRule Result

The following output properties are available:

BackendAddressPoolId string

A reference to a Backend Address Pool over which this Load Balancing Rule operates.

BackendPort int

The port used for internal connections on the endpoint.

DisableOutboundSnat bool

If outbound SNAT is enabled for this Load Balancer Rule.

EnableFloatingIp bool

If Floating IPs are enabled for this Load Balancer Rule

EnableTcpReset bool

If TCP Reset is enabled for this Load Balancer Rule.

FrontendIpConfigurationName string

The name of the frontend IP configuration to which the rule is associated.

FrontendPort int

The port for the external endpoint.

Id string

The provider-assigned unique ID for this managed resource.

IdleTimeoutInMinutes int

Specifies the idle timeout in minutes for TCP connections.

LoadDistribution string

Specifies the load balancing distribution type used by the Load Balancer.

LoadbalancerId string
Name string
ProbeId string

A reference to a Probe used by this Load Balancing Rule.

Protocol string

The transport protocol for the external endpoint.

BackendAddressPoolId string

A reference to a Backend Address Pool over which this Load Balancing Rule operates.

BackendPort int

The port used for internal connections on the endpoint.

DisableOutboundSnat bool

If outbound SNAT is enabled for this Load Balancer Rule.

EnableFloatingIp bool

If Floating IPs are enabled for this Load Balancer Rule

EnableTcpReset bool

If TCP Reset is enabled for this Load Balancer Rule.

FrontendIpConfigurationName string

The name of the frontend IP configuration to which the rule is associated.

FrontendPort int

The port for the external endpoint.

Id string

The provider-assigned unique ID for this managed resource.

IdleTimeoutInMinutes int

Specifies the idle timeout in minutes for TCP connections.

LoadDistribution string

Specifies the load balancing distribution type used by the Load Balancer.

LoadbalancerId string
Name string
ProbeId string

A reference to a Probe used by this Load Balancing Rule.

Protocol string

The transport protocol for the external endpoint.

backendAddressPoolId String

A reference to a Backend Address Pool over which this Load Balancing Rule operates.

backendPort Integer

The port used for internal connections on the endpoint.

disableOutboundSnat Boolean

If outbound SNAT is enabled for this Load Balancer Rule.

enableFloatingIp Boolean

If Floating IPs are enabled for this Load Balancer Rule

enableTcpReset Boolean

If TCP Reset is enabled for this Load Balancer Rule.

frontendIpConfigurationName String

The name of the frontend IP configuration to which the rule is associated.

frontendPort Integer

The port for the external endpoint.

id String

The provider-assigned unique ID for this managed resource.

idleTimeoutInMinutes Integer

Specifies the idle timeout in minutes for TCP connections.

loadDistribution String

Specifies the load balancing distribution type used by the Load Balancer.

loadbalancerId String
name String
probeId String

A reference to a Probe used by this Load Balancing Rule.

protocol String

The transport protocol for the external endpoint.

backendAddressPoolId string

A reference to a Backend Address Pool over which this Load Balancing Rule operates.

backendPort number

The port used for internal connections on the endpoint.

disableOutboundSnat boolean

If outbound SNAT is enabled for this Load Balancer Rule.

enableFloatingIp boolean

If Floating IPs are enabled for this Load Balancer Rule

enableTcpReset boolean

If TCP Reset is enabled for this Load Balancer Rule.

frontendIpConfigurationName string

The name of the frontend IP configuration to which the rule is associated.

frontendPort number

The port for the external endpoint.

id string

The provider-assigned unique ID for this managed resource.

idleTimeoutInMinutes number

Specifies the idle timeout in minutes for TCP connections.

loadDistribution string

Specifies the load balancing distribution type used by the Load Balancer.

loadbalancerId string
name string
probeId string

A reference to a Probe used by this Load Balancing Rule.

protocol string

The transport protocol for the external endpoint.

backend_address_pool_id str

A reference to a Backend Address Pool over which this Load Balancing Rule operates.

backend_port int

The port used for internal connections on the endpoint.

disable_outbound_snat bool

If outbound SNAT is enabled for this Load Balancer Rule.

enable_floating_ip bool

If Floating IPs are enabled for this Load Balancer Rule

enable_tcp_reset bool

If TCP Reset is enabled for this Load Balancer Rule.

frontend_ip_configuration_name str

The name of the frontend IP configuration to which the rule is associated.

frontend_port int

The port for the external endpoint.

id str

The provider-assigned unique ID for this managed resource.

idle_timeout_in_minutes int

Specifies the idle timeout in minutes for TCP connections.

load_distribution str

Specifies the load balancing distribution type used by the Load Balancer.

loadbalancer_id str
name str
probe_id str

A reference to a Probe used by this Load Balancing Rule.

protocol str

The transport protocol for the external endpoint.

backendAddressPoolId String

A reference to a Backend Address Pool over which this Load Balancing Rule operates.

backendPort Number

The port used for internal connections on the endpoint.

disableOutboundSnat Boolean

If outbound SNAT is enabled for this Load Balancer Rule.

enableFloatingIp Boolean

If Floating IPs are enabled for this Load Balancer Rule

enableTcpReset Boolean

If TCP Reset is enabled for this Load Balancer Rule.

frontendIpConfigurationName String

The name of the frontend IP configuration to which the rule is associated.

frontendPort Number

The port for the external endpoint.

id String

The provider-assigned unique ID for this managed resource.

idleTimeoutInMinutes Number

Specifies the idle timeout in minutes for TCP connections.

loadDistribution String

Specifies the load balancing distribution type used by the Load Balancer.

loadbalancerId String
name String
probeId String

A reference to a Probe used by this Load Balancing Rule.

protocol String

The transport protocol for the external endpoint.

Package Details

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

This Pulumi package is based on the azurerm Terraform Provider.