getLBRule

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

Example Usage

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 com.pulumi.azure.lb.inputs.GetLBRuleArgs;
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());
final var exampleGetLBRule = LbFunctions.getLBRule(GetLBRuleArgs.builder()
.name("first")
.resourceGroupName("example-resources")
.loadbalancerId(example.applyValue(getLBResult -> getLBResult.id()))
.build());
ctx.export("lbRuleId", exampleGetLBRule.applyValue(getLBRuleResult -> getLBRuleResult.id()));
}
}
variables:
example:
fn::invoke:
function: azure:lb:getLB
arguments:
name: example-lb
resourceGroupName: example-resources
exampleGetLBRule:
fn::invoke:
function: azure:lb:getLBRule
arguments:
name: first
resourceGroupName: example-resources
loadbalancerId: ${example.id}
outputs:
lbRuleId: ${exampleGetLBRule.id}

Return

A collection of values returned by getLBRule.

Parameters

argument

A collection of arguments for invoking getLBRule.


suspend fun getLBRule(loadbalancerId: String, name: String): GetLBRuleResult

Return

A collection of values returned by getLBRule.

Parameters

loadbalancerId

The ID of the Load Balancer Rule.

name

The name of this Load Balancer Rule.

See also


suspend fun getLBRule(argument: suspend GetLBRulePlainArgsBuilder.() -> Unit): GetLBRuleResult

Return

A collection of values returned by getLBRule.

Parameters

argument

Builder for com.pulumi.azure.lb.kotlin.inputs.GetLBRulePlainArgs.

See also