We recommend using Azure Native.
azure.lb.Rule
Explore with Pulumi AI
Manages a Load Balancer Rule.
NOTE When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
    name: "LoadBalancerRG",
    location: "West Europe",
});
const examplePublicIp = new azure.network.PublicIp("example", {
    name: "PublicIPForLB",
    location: "West US",
    resourceGroupName: example.name,
    allocationMethod: "Static",
});
const exampleLoadBalancer = new azure.lb.LoadBalancer("example", {
    name: "TestLoadBalancer",
    location: "West US",
    resourceGroupName: example.name,
    frontendIpConfigurations: [{
        name: "PublicIPAddress",
        publicIpAddressId: examplePublicIp.id,
    }],
});
const exampleRule = new azure.lb.Rule("example", {
    loadbalancerId: exampleLoadBalancer.id,
    name: "LBRule",
    protocol: "Tcp",
    frontendPort: 3389,
    backendPort: 3389,
    frontendIpConfigurationName: "PublicIPAddress",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
    name="LoadBalancerRG",
    location="West Europe")
example_public_ip = azure.network.PublicIp("example",
    name="PublicIPForLB",
    location="West US",
    resource_group_name=example.name,
    allocation_method="Static")
example_load_balancer = azure.lb.LoadBalancer("example",
    name="TestLoadBalancer",
    location="West US",
    resource_group_name=example.name,
    frontend_ip_configurations=[{
        "name": "PublicIPAddress",
        "public_ip_address_id": example_public_ip.id,
    }])
example_rule = azure.lb.Rule("example",
    loadbalancer_id=example_load_balancer.id,
    name="LBRule",
    protocol="Tcp",
    frontend_port=3389,
    backend_port=3389,
    frontend_ip_configuration_name="PublicIPAddress")
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/lb"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("LoadBalancerRG"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
			Name:              pulumi.String("PublicIPForLB"),
			Location:          pulumi.String("West US"),
			ResourceGroupName: example.Name,
			AllocationMethod:  pulumi.String("Static"),
		})
		if err != nil {
			return err
		}
		exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
			Name:              pulumi.String("TestLoadBalancer"),
			Location:          pulumi.String("West US"),
			ResourceGroupName: example.Name,
			FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{
				&lb.LoadBalancerFrontendIpConfigurationArgs{
					Name:              pulumi.String("PublicIPAddress"),
					PublicIpAddressId: examplePublicIp.ID(),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = lb.NewRule(ctx, "example", &lb.RuleArgs{
			LoadbalancerId:              exampleLoadBalancer.ID(),
			Name:                        pulumi.String("LBRule"),
			Protocol:                    pulumi.String("Tcp"),
			FrontendPort:                pulumi.Int(3389),
			BackendPort:                 pulumi.Int(3389),
			FrontendIpConfigurationName: pulumi.String("PublicIPAddress"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "LoadBalancerRG",
        Location = "West Europe",
    });
    var examplePublicIp = new Azure.Network.PublicIp("example", new()
    {
        Name = "PublicIPForLB",
        Location = "West US",
        ResourceGroupName = example.Name,
        AllocationMethod = "Static",
    });
    var exampleLoadBalancer = new Azure.Lb.LoadBalancer("example", new()
    {
        Name = "TestLoadBalancer",
        Location = "West US",
        ResourceGroupName = example.Name,
        FrontendIpConfigurations = new[]
        {
            new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs
            {
                Name = "PublicIPAddress",
                PublicIpAddressId = examplePublicIp.Id,
            },
        },
    });
    var exampleRule = new Azure.Lb.Rule("example", new()
    {
        LoadbalancerId = exampleLoadBalancer.Id,
        Name = "LBRule",
        Protocol = "Tcp",
        FrontendPort = 3389,
        BackendPort = 3389,
        FrontendIpConfigurationName = "PublicIPAddress",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.PublicIp;
import com.pulumi.azure.network.PublicIpArgs;
import com.pulumi.azure.lb.LoadBalancer;
import com.pulumi.azure.lb.LoadBalancerArgs;
import com.pulumi.azure.lb.inputs.LoadBalancerFrontendIpConfigurationArgs;
import com.pulumi.azure.lb.Rule;
import com.pulumi.azure.lb.RuleArgs;
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) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("LoadBalancerRG")
            .location("West Europe")
            .build());
        var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
            .name("PublicIPForLB")
            .location("West US")
            .resourceGroupName(example.name())
            .allocationMethod("Static")
            .build());
        var exampleLoadBalancer = new LoadBalancer("exampleLoadBalancer", LoadBalancerArgs.builder()
            .name("TestLoadBalancer")
            .location("West US")
            .resourceGroupName(example.name())
            .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
                .name("PublicIPAddress")
                .publicIpAddressId(examplePublicIp.id())
                .build())
            .build());
        var exampleRule = new Rule("exampleRule", RuleArgs.builder()
            .loadbalancerId(exampleLoadBalancer.id())
            .name("LBRule")
            .protocol("Tcp")
            .frontendPort(3389)
            .backendPort(3389)
            .frontendIpConfigurationName("PublicIPAddress")
            .build());
    }
}
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: LoadBalancerRG
      location: West Europe
  examplePublicIp:
    type: azure:network:PublicIp
    name: example
    properties:
      name: PublicIPForLB
      location: West US
      resourceGroupName: ${example.name}
      allocationMethod: Static
  exampleLoadBalancer:
    type: azure:lb:LoadBalancer
    name: example
    properties:
      name: TestLoadBalancer
      location: West US
      resourceGroupName: ${example.name}
      frontendIpConfigurations:
        - name: PublicIPAddress
          publicIpAddressId: ${examplePublicIp.id}
  exampleRule:
    type: azure:lb:Rule
    name: example
    properties:
      loadbalancerId: ${exampleLoadBalancer.id}
      name: LBRule
      protocol: Tcp
      frontendPort: 3389
      backendPort: 3389
      frontendIpConfigurationName: PublicIPAddress
Create Rule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);@overload
def Rule(resource_name: str,
         args: RuleArgs,
         opts: Optional[ResourceOptions] = None)
@overload
def Rule(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         loadbalancer_id: Optional[str] = None,
         backend_port: Optional[int] = None,
         frontend_ip_configuration_name: Optional[str] = None,
         frontend_port: Optional[int] = None,
         protocol: Optional[str] = None,
         disable_outbound_snat: Optional[bool] = None,
         enable_floating_ip: Optional[bool] = None,
         enable_tcp_reset: Optional[bool] = None,
         idle_timeout_in_minutes: Optional[int] = None,
         load_distribution: Optional[str] = None,
         backend_address_pool_ids: Optional[Sequence[str]] = None,
         name: Optional[str] = None,
         probe_id: Optional[str] = None)func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)type: azure:lb:Rule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var ruleResource = new Azure.Lb.Rule("ruleResource", new()
{
    LoadbalancerId = "string",
    BackendPort = 0,
    FrontendIpConfigurationName = "string",
    FrontendPort = 0,
    Protocol = "string",
    DisableOutboundSnat = false,
    EnableFloatingIp = false,
    EnableTcpReset = false,
    IdleTimeoutInMinutes = 0,
    LoadDistribution = "string",
    BackendAddressPoolIds = new[]
    {
        "string",
    },
    Name = "string",
    ProbeId = "string",
});
example, err := lb.NewRule(ctx, "ruleResource", &lb.RuleArgs{
	LoadbalancerId:              pulumi.String("string"),
	BackendPort:                 pulumi.Int(0),
	FrontendIpConfigurationName: pulumi.String("string"),
	FrontendPort:                pulumi.Int(0),
	Protocol:                    pulumi.String("string"),
	DisableOutboundSnat:         pulumi.Bool(false),
	EnableFloatingIp:            pulumi.Bool(false),
	EnableTcpReset:              pulumi.Bool(false),
	IdleTimeoutInMinutes:        pulumi.Int(0),
	LoadDistribution:            pulumi.String("string"),
	BackendAddressPoolIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name:    pulumi.String("string"),
	ProbeId: pulumi.String("string"),
})
var ruleResource = new Rule("ruleResource", RuleArgs.builder()
    .loadbalancerId("string")
    .backendPort(0)
    .frontendIpConfigurationName("string")
    .frontendPort(0)
    .protocol("string")
    .disableOutboundSnat(false)
    .enableFloatingIp(false)
    .enableTcpReset(false)
    .idleTimeoutInMinutes(0)
    .loadDistribution("string")
    .backendAddressPoolIds("string")
    .name("string")
    .probeId("string")
    .build());
rule_resource = azure.lb.Rule("ruleResource",
    loadbalancer_id="string",
    backend_port=0,
    frontend_ip_configuration_name="string",
    frontend_port=0,
    protocol="string",
    disable_outbound_snat=False,
    enable_floating_ip=False,
    enable_tcp_reset=False,
    idle_timeout_in_minutes=0,
    load_distribution="string",
    backend_address_pool_ids=["string"],
    name="string",
    probe_id="string")
const ruleResource = new azure.lb.Rule("ruleResource", {
    loadbalancerId: "string",
    backendPort: 0,
    frontendIpConfigurationName: "string",
    frontendPort: 0,
    protocol: "string",
    disableOutboundSnat: false,
    enableFloatingIp: false,
    enableTcpReset: false,
    idleTimeoutInMinutes: 0,
    loadDistribution: "string",
    backendAddressPoolIds: ["string"],
    name: "string",
    probeId: "string",
});
type: azure:lb:Rule
properties:
    backendAddressPoolIds:
        - string
    backendPort: 0
    disableOutboundSnat: false
    enableFloatingIp: false
    enableTcpReset: false
    frontendIpConfigurationName: string
    frontendPort: 0
    idleTimeoutInMinutes: 0
    loadDistribution: string
    loadbalancerId: string
    name: string
    probeId: string
    protocol: string
Rule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Rule resource accepts the following input properties:
- BackendPort int
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- FrontendIp stringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- FrontendPort int
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- LoadbalancerId string
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- Protocol string
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- BackendAddress List<string>Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- DisableOutbound boolSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- EnableFloating boolIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- EnableTcp boolReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- IdleTimeout intIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- LoadDistribution string
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- Name string
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- ProbeId string
- A reference to a Probe used by this Load Balancing Rule.
- BackendPort int
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- FrontendIp stringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- FrontendPort int
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- LoadbalancerId string
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- Protocol string
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- BackendAddress []stringPool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- DisableOutbound boolSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- EnableFloating boolIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- EnableTcp boolReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- IdleTimeout intIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- LoadDistribution string
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- Name string
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- ProbeId string
- A reference to a Probe used by this Load Balancing Rule.
- backendPort Integer
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- frontendIp StringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- frontendPort Integer
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- loadbalancerId String
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- protocol String
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backendAddress List<String>Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- disableOutbound BooleanSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enableFloating BooleanIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enableTcp BooleanReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- idleTimeout IntegerIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- loadDistribution String
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- name String
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probeId String
- A reference to a Probe used by this Load Balancing Rule.
- backendPort number
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- frontendIp stringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- frontendPort number
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- loadbalancerId string
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- protocol string
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backendAddress string[]Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- disableOutbound booleanSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enableFloating booleanIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enableTcp booleanReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- idleTimeout numberIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- loadDistribution string
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- name string
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probeId string
- A reference to a Probe used by this Load Balancing Rule.
- backend_port int
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- 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. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- loadbalancer_id str
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- protocol str
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backend_address_ Sequence[str]pool_ ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- disable_outbound_ boolsnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enable_floating_ boolip 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enable_tcp_ boolreset 
- Is TCP Reset enabled for this Load Balancer Rule?
- idle_timeout_ intin_ minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- load_distribution str
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- name str
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probe_id str
- A reference to a Probe used by this Load Balancing Rule.
- backendPort Number
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- frontendIp StringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- frontendPort Number
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- loadbalancerId String
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- protocol String
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backendAddress List<String>Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- disableOutbound BooleanSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enableFloating BooleanIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enableTcp BooleanReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- idleTimeout NumberIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- loadDistribution String
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- name String
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probeId String
- A reference to a Probe used by this Load Balancing Rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the Rule resource produces the following output properties:
- FrontendIp stringConfiguration Id 
- Id string
- The provider-assigned unique ID for this managed resource.
- FrontendIp stringConfiguration Id 
- Id string
- The provider-assigned unique ID for this managed resource.
- frontendIp StringConfiguration Id 
- id String
- The provider-assigned unique ID for this managed resource.
- frontendIp stringConfiguration Id 
- id string
- The provider-assigned unique ID for this managed resource.
- frontend_ip_ strconfiguration_ id 
- id str
- The provider-assigned unique ID for this managed resource.
- frontendIp StringConfiguration Id 
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Rule Resource
Get an existing Rule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RuleState, opts?: CustomResourceOptions): Rule@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backend_address_pool_ids: Optional[Sequence[str]] = None,
        backend_port: Optional[int] = None,
        disable_outbound_snat: Optional[bool] = None,
        enable_floating_ip: Optional[bool] = None,
        enable_tcp_reset: Optional[bool] = None,
        frontend_ip_configuration_id: Optional[str] = None,
        frontend_ip_configuration_name: Optional[str] = None,
        frontend_port: Optional[int] = None,
        idle_timeout_in_minutes: Optional[int] = None,
        load_distribution: Optional[str] = None,
        loadbalancer_id: Optional[str] = None,
        name: Optional[str] = None,
        probe_id: Optional[str] = None,
        protocol: Optional[str] = None) -> Rulefunc GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)resources:  _:    type: azure:lb:Rule    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- BackendAddress List<string>Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- BackendPort int
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- DisableOutbound boolSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- EnableFloating boolIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- EnableTcp boolReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- FrontendIp stringConfiguration Id 
- FrontendIp stringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- FrontendPort int
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- IdleTimeout intIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- LoadDistribution string
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- LoadbalancerId string
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- ProbeId string
- A reference to a Probe used by this Load Balancing Rule.
- Protocol string
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- BackendAddress []stringPool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- BackendPort int
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- DisableOutbound boolSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- EnableFloating boolIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- EnableTcp boolReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- FrontendIp stringConfiguration Id 
- FrontendIp stringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- FrontendPort int
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- IdleTimeout intIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- LoadDistribution string
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- LoadbalancerId string
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- ProbeId string
- A reference to a Probe used by this Load Balancing Rule.
- Protocol string
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backendAddress List<String>Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- backendPort Integer
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- disableOutbound BooleanSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enableFloating BooleanIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enableTcp BooleanReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- frontendIp StringConfiguration Id 
- frontendIp StringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- frontendPort Integer
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- idleTimeout IntegerIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- loadDistribution String
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- loadbalancerId String
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- name String
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probeId String
- A reference to a Probe used by this Load Balancing Rule.
- protocol String
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backendAddress string[]Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- backendPort number
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- disableOutbound booleanSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enableFloating booleanIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enableTcp booleanReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- frontendIp stringConfiguration Id 
- frontendIp stringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- frontendPort number
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- idleTimeout numberIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- loadDistribution string
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- loadbalancerId string
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- name string
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probeId string
- A reference to a Probe used by this Load Balancing Rule.
- protocol string
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backend_address_ Sequence[str]pool_ ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- backend_port int
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- disable_outbound_ boolsnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enable_floating_ boolip 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enable_tcp_ boolreset 
- Is TCP Reset enabled for this Load Balancer Rule?
- frontend_ip_ strconfiguration_ id 
- 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. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- idle_timeout_ intin_ minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- load_distribution str
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- loadbalancer_id str
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- name str
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probe_id str
- A reference to a Probe used by this Load Balancing Rule.
- protocol str
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
- backendAddress List<String>Pool Ids 
- A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. - NOTE: In most cases users can only set one Backend Address Pool ID in the - backend_address_pool_ids. Especially, when the sku of the LB is- Gateway, users can set up to two IDs in the- backend_address_pool_ids.
- backendPort Number
- The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of 0means "Any Port".
- disableOutbound BooleanSnat 
- Is snat enabled for this Load Balancer Rule? Default false.
- enableFloating BooleanIp 
- Are the Floating IPs enabled for this Load Balancer Rule? A "floating” IP is reassigned to a secondary server in case the primary server fails. Required to configure a SQL AlwaysOn Availability Group. Defaults to false.
- enableTcp BooleanReset 
- Is TCP Reset enabled for this Load Balancer Rule?
- frontendIp StringConfiguration Id 
- frontendIp StringConfiguration Name 
- The name of the frontend IP configuration to which the rule is associated.
- frontendPort Number
- The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 0 and 65534, inclusive. A port of 0means "Any Port".
- idleTimeout NumberIn Minutes 
- Specifies the idle timeout in minutes for TCP connections. Valid values are between 4and100minutes. Defaults to4minutes.
- loadDistribution String
- Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: Default– The load balancer is configured to use a 5 tuple hash to map traffic to available servers.SourceIP– The load balancer is configured to use a 2 tuple hash to map traffic to available servers.SourceIPProtocol– The load balancer is configured to use a 3 tuple hash to map traffic to available servers. Also known as Session Persistence, where in the Azure portal the options are calledNone,Client IPandClient IP and Protocolrespectively. Defaults toDefault.
- loadbalancerId String
- The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.
- name String
- Specifies the name of the LB Rule. Changing this forces a new resource to be created.
- probeId String
- A reference to a Probe used by this Load Balancing Rule.
- protocol String
- The transport protocol for the external endpoint. Possible values are Tcp,UdporAll.
Import
Load Balancer Rules can be imported using the resource id, e.g.
$ pulumi import azure:lb/rule:Rule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.