NatRuleArgs

data class NatRuleArgs(val backendAddressPoolId: Output<String>? = null, val backendPort: Output<Int>? = null, val enableFloatingIp: Output<Boolean>? = null, val enableTcpReset: Output<Boolean>? = null, val frontendIpConfigurationName: Output<String>? = null, val frontendPort: Output<Int>? = null, val frontendPortEnd: Output<Int>? = null, val frontendPortStart: Output<Int>? = null, val idleTimeoutInMinutes: Output<Int>? = null, val loadbalancerId: Output<String>? = null, val name: Output<String>? = null, val protocol: Output<String>? = null, val resourceGroupName: Output<String>? = null) : ConvertibleToJava<NatRuleArgs>

Manages a Load Balancer NAT Rule.

NOTE: This resource cannot be used with with virtual machine scale sets, instead use the azure.lb.NatPool resource. 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.BackendAddressPool;
import com.pulumi.azure.lb.BackendAddressPoolArgs;
import com.pulumi.azure.lb.NatRule;
import com.pulumi.azure.lb.NatRuleArgs;
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 exampleBackendAddressPool = new BackendAddressPool("exampleBackendAddressPool", BackendAddressPoolArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.loadbalancerId(exampleLoadBalancer.id())
.build());
var exampleNatRule = new NatRule("exampleNatRule", NatRuleArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.loadbalancerId(exampleLoadBalancer.id())
.protocol("Tcp")
.frontendPort(3389)
.backendPort(3389)
.frontendIpConfigurationName("PublicIPAddress")
.build());
var example1 = new NatRule("example1", NatRuleArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.loadbalancerId(exampleLoadBalancer.id())
.protocol("Tcp")
.frontendPortStart(3000)
.frontendPortEnd(3389)
.backendPort(3389)
.backendAddressPoolId(exampleBackendAddressPool.id())
.frontendIpConfigurationName("PublicIPAddress")
.build());
}
}

Import

Load Balancer NAT Rules can be imported using the resource id, e.g.

$ pulumi import azure:lb/natRule:NatRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule1

Constructors

Link copied to clipboard
fun NatRuleArgs(backendAddressPoolId: Output<String>? = null, backendPort: Output<Int>? = null, enableFloatingIp: Output<Boolean>? = null, enableTcpReset: Output<Boolean>? = null, frontendIpConfigurationName: Output<String>? = null, frontendPort: Output<Int>? = null, frontendPortEnd: Output<Int>? = null, frontendPortStart: Output<Int>? = null, idleTimeoutInMinutes: Output<Int>? = null, loadbalancerId: Output<String>? = null, name: Output<String>? = null, protocol: Output<String>? = null, resourceGroupName: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): NatRuleArgs

Properties

Link copied to clipboard
val backendAddressPoolId: Output<String>? = null

Specifies a reference to backendAddressPool resource.

Link copied to clipboard
val backendPort: Output<Int>? = null

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

Link copied to clipboard
val enableFloatingIp: Output<Boolean>? = null

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.

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

Is TCP Reset enabled for this Load Balancer Rule?

Link copied to clipboard
val frontendIpConfigurationName: Output<String>? = null

The name of the frontend IP configuration exposing this rule.

Link copied to clipboard
val frontendPort: Output<Int>? = null

The port for the external endpoint. Port numbers for each Rule must be unique within the Load Balancer. Possible values range between 1 and 65534, inclusive.

Link copied to clipboard
val frontendPortEnd: Output<Int>? = null

The port range end for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534, inclusive.

Link copied to clipboard
val frontendPortStart: Output<Int>? = null

The port range start for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534, inclusive.

Link copied to clipboard
val idleTimeoutInMinutes: Output<Int>? = null

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>? = null

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

Link copied to clipboard
val name: Output<String>? = null

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

Link copied to clipboard
val protocol: Output<String>? = null

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

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group in which to create the resource. Changing this forces a new resource to be created.