Rule

class Rule : KotlinCustomResource

Manages a Load Balancer Rule.

NOTE When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached

Example Usage

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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
.location("West US")
.resourceGroupName(exampleResourceGroup.name())
.allocationMethod("Static")
.build());
var exampleLoadBalancer = new LoadBalancer("exampleLoadBalancer", LoadBalancerArgs.builder()
.location("West US")
.resourceGroupName(exampleResourceGroup.name())
.frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
.name("PublicIPAddress")
.publicIpAddressId(examplePublicIp.id())
.build())
.build());
var exampleRule = new Rule("exampleRule", RuleArgs.builder()
.loadbalancerId(exampleLoadBalancer.id())
.protocol("Tcp")
.frontendPort(3389)
.backendPort(3389)
.frontendIpConfigurationName("PublicIPAddress")
.build());
}
}

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

Properties

Link copied to clipboard

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

Link copied to clipboard
val backendPort: Output<Int>

The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive.

Link copied to clipboard

Is snat enabled for this Load Balancer Rule? Default false.

Link copied to clipboard

Are the Floating IPs enabled for this Load Balncer 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.

Link copied to clipboard
val enableTcpReset: Output<Boolean>?

Is TCP Reset enabled for this Load Balancer Rule?

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
val frontendPort: Output<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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.

Link copied to clipboard
val loadbalancerId: Output<String>

The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created.

Link copied to clipboard

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 the options are called None, Client IP and Client IP and Protocol respectively.

Link copied to clipboard
val name: Output<String>

Specifies the name of the LB Rule. Changing this forces a new resource to be created.

Link copied to clipboard
val probeId: Output<String>

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

Link copied to clipboard
val protocol: Output<String>

The transport protocol for the external endpoint. Possible values are Tcp, Udp or All.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>