We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.lb.getLBRule
Explore with Pulumi AI
Use this data source to access information about an existing Load Balancer Rule.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
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}
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)
public static Output<GetLBRuleResult> getLBRule(GetLBRuleArgs args, InvokeOptions options)
fn::invoke:
  function: azure:lb/getLBRule:getLBRule
  arguments:
    # arguments dictionaryThe 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:
- BackendAddress stringPool Id 
- 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.
- DisableOutbound boolSnat 
- If outbound SNAT is enabled for this Load Balancer Rule.
- EnableFloating boolIp 
- If Floating IPs are enabled for this Load Balancer Rule
- EnableTcp boolReset 
- If TCP Reset is enabled for this Load Balancer Rule.
- FrontendIp stringConfiguration Name 
- 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.
- IdleTimeout intIn Minutes 
- 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.
- BackendAddress stringPool Id 
- 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.
- DisableOutbound boolSnat 
- If outbound SNAT is enabled for this Load Balancer Rule.
- EnableFloating boolIp 
- If Floating IPs are enabled for this Load Balancer Rule
- EnableTcp boolReset 
- If TCP Reset is enabled for this Load Balancer Rule.
- FrontendIp stringConfiguration Name 
- 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.
- IdleTimeout intIn Minutes 
- 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.
- backendAddress StringPool Id 
- 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.
- disableOutbound BooleanSnat 
- If outbound SNAT is enabled for this Load Balancer Rule.
- enableFloating BooleanIp 
- If Floating IPs are enabled for this Load Balancer Rule
- enableTcp BooleanReset 
- If TCP Reset is enabled for this Load Balancer Rule.
- frontendIp StringConfiguration Name 
- 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.
- idleTimeout IntegerIn Minutes 
- 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.
- backendAddress stringPool Id 
- 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.
- disableOutbound booleanSnat 
- If outbound SNAT is enabled for this Load Balancer Rule.
- enableFloating booleanIp 
- If Floating IPs are enabled for this Load Balancer Rule
- enableTcp booleanReset 
- If TCP Reset is enabled for this Load Balancer Rule.
- frontendIp stringConfiguration Name 
- 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.
- idleTimeout numberIn Minutes 
- 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_ strpool_ id 
- 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_ boolsnat 
- If outbound SNAT is enabled for this Load Balancer Rule.
- enable_floating_ boolip 
- If Floating IPs are enabled for this Load Balancer Rule
- enable_tcp_ boolreset 
- If TCP Reset is enabled for this Load Balancer Rule.
- frontend_ip_ strconfiguration_ name 
- 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_ intin_ minutes 
- 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.
- backendAddress StringPool Id 
- 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.
- disableOutbound BooleanSnat 
- If outbound SNAT is enabled for this Load Balancer Rule.
- enableFloating BooleanIp 
- If Floating IPs are enabled for this Load Balancer Rule
- enableTcp BooleanReset 
- If TCP Reset is enabled for this Load Balancer Rule.
- frontendIp StringConfiguration Name 
- 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.
- idleTimeout NumberIn Minutes 
- 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
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.