We recommend using Azure Native.
azure.lb.NatRule
Explore with Pulumi AI
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
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 exampleBackendAddressPool = new azure.lb.BackendAddressPool("example", {
loadbalancerId: exampleLoadBalancer.id,
name: "be",
});
const exampleNatRule = new azure.lb.NatRule("example", {
resourceGroupName: example.name,
loadbalancerId: exampleLoadBalancer.id,
name: "RDPAccess",
protocol: "Tcp",
frontendPort: 3389,
backendPort: 3389,
frontendIpConfigurationName: "PublicIPAddress",
});
const example1 = new azure.lb.NatRule("example1", {
resourceGroupName: example.name,
loadbalancerId: exampleLoadBalancer.id,
name: "RDPAccess",
protocol: "Tcp",
frontendPortStart: 3000,
frontendPortEnd: 3389,
backendPort: 3389,
backendAddressPoolId: exampleBackendAddressPool.id,
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_backend_address_pool = azure.lb.BackendAddressPool("example",
loadbalancer_id=example_load_balancer.id,
name="be")
example_nat_rule = azure.lb.NatRule("example",
resource_group_name=example.name,
loadbalancer_id=example_load_balancer.id,
name="RDPAccess",
protocol="Tcp",
frontend_port=3389,
backend_port=3389,
frontend_ip_configuration_name="PublicIPAddress")
example1 = azure.lb.NatRule("example1",
resource_group_name=example.name,
loadbalancer_id=example_load_balancer.id,
name="RDPAccess",
protocol="Tcp",
frontend_port_start=3000,
frontend_port_end=3389,
backend_port=3389,
backend_address_pool_id=example_backend_address_pool.id,
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
}
exampleBackendAddressPool, err := lb.NewBackendAddressPool(ctx, "example", &lb.BackendAddressPoolArgs{
LoadbalancerId: exampleLoadBalancer.ID(),
Name: pulumi.String("be"),
})
if err != nil {
return err
}
_, err = lb.NewNatRule(ctx, "example", &lb.NatRuleArgs{
ResourceGroupName: example.Name,
LoadbalancerId: exampleLoadBalancer.ID(),
Name: pulumi.String("RDPAccess"),
Protocol: pulumi.String("Tcp"),
FrontendPort: pulumi.Int(3389),
BackendPort: pulumi.Int(3389),
FrontendIpConfigurationName: pulumi.String("PublicIPAddress"),
})
if err != nil {
return err
}
_, err = lb.NewNatRule(ctx, "example1", &lb.NatRuleArgs{
ResourceGroupName: example.Name,
LoadbalancerId: exampleLoadBalancer.ID(),
Name: pulumi.String("RDPAccess"),
Protocol: pulumi.String("Tcp"),
FrontendPortStart: pulumi.Int(3000),
FrontendPortEnd: pulumi.Int(3389),
BackendPort: pulumi.Int(3389),
BackendAddressPoolId: exampleBackendAddressPool.ID(),
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 exampleBackendAddressPool = new Azure.Lb.BackendAddressPool("example", new()
{
LoadbalancerId = exampleLoadBalancer.Id,
Name = "be",
});
var exampleNatRule = new Azure.Lb.NatRule("example", new()
{
ResourceGroupName = example.Name,
LoadbalancerId = exampleLoadBalancer.Id,
Name = "RDPAccess",
Protocol = "Tcp",
FrontendPort = 3389,
BackendPort = 3389,
FrontendIpConfigurationName = "PublicIPAddress",
});
var example1 = new Azure.Lb.NatRule("example1", new()
{
ResourceGroupName = example.Name,
LoadbalancerId = exampleLoadBalancer.Id,
Name = "RDPAccess",
Protocol = "Tcp",
FrontendPortStart = 3000,
FrontendPortEnd = 3389,
BackendPort = 3389,
BackendAddressPoolId = exampleBackendAddressPool.Id,
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.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 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 exampleBackendAddressPool = new BackendAddressPool("exampleBackendAddressPool", BackendAddressPoolArgs.builder()
.loadbalancerId(exampleLoadBalancer.id())
.name("be")
.build());
var exampleNatRule = new NatRule("exampleNatRule", NatRuleArgs.builder()
.resourceGroupName(example.name())
.loadbalancerId(exampleLoadBalancer.id())
.name("RDPAccess")
.protocol("Tcp")
.frontendPort(3389)
.backendPort(3389)
.frontendIpConfigurationName("PublicIPAddress")
.build());
var example1 = new NatRule("example1", NatRuleArgs.builder()
.resourceGroupName(example.name())
.loadbalancerId(exampleLoadBalancer.id())
.name("RDPAccess")
.protocol("Tcp")
.frontendPortStart(3000)
.frontendPortEnd(3389)
.backendPort(3389)
.backendAddressPoolId(exampleBackendAddressPool.id())
.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}
exampleBackendAddressPool:
type: azure:lb:BackendAddressPool
name: example
properties:
loadbalancerId: ${exampleLoadBalancer.id}
name: be
exampleNatRule:
type: azure:lb:NatRule
name: example
properties:
resourceGroupName: ${example.name}
loadbalancerId: ${exampleLoadBalancer.id}
name: RDPAccess
protocol: Tcp
frontendPort: 3389
backendPort: 3389
frontendIpConfigurationName: PublicIPAddress
example1:
type: azure:lb:NatRule
properties:
resourceGroupName: ${example.name}
loadbalancerId: ${exampleLoadBalancer.id}
name: RDPAccess
protocol: Tcp
frontendPortStart: 3000
frontendPortEnd: 3389
backendPort: 3389
backendAddressPoolId: ${exampleBackendAddressPool.id}
frontendIpConfigurationName: PublicIPAddress
Create NatRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NatRule(name: string, args: NatRuleArgs, opts?: CustomResourceOptions);
@overload
def NatRule(resource_name: str,
args: NatRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def NatRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
loadbalancer_id: Optional[str] = None,
backend_port: Optional[int] = None,
resource_group_name: Optional[str] = None,
protocol: Optional[str] = None,
frontend_ip_configuration_name: Optional[str] = None,
enable_tcp_reset: Optional[bool] = None,
frontend_port_end: Optional[int] = None,
frontend_port_start: Optional[int] = None,
idle_timeout_in_minutes: Optional[int] = None,
frontend_port: Optional[int] = None,
name: Optional[str] = None,
backend_address_pool_id: Optional[str] = None,
enable_floating_ip: Optional[bool] = None)
func NewNatRule(ctx *Context, name string, args NatRuleArgs, opts ...ResourceOption) (*NatRule, error)
public NatRule(string name, NatRuleArgs args, CustomResourceOptions? opts = null)
public NatRule(String name, NatRuleArgs args)
public NatRule(String name, NatRuleArgs args, CustomResourceOptions options)
type: azure:lb:NatRule
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 NatRuleArgs
- 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 NatRuleArgs
- 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 NatRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NatRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NatRuleArgs
- 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 natRuleResource = new Azure.Lb.NatRule("natRuleResource", new()
{
LoadbalancerId = "string",
BackendPort = 0,
ResourceGroupName = "string",
Protocol = "string",
FrontendIpConfigurationName = "string",
EnableTcpReset = false,
FrontendPortEnd = 0,
FrontendPortStart = 0,
IdleTimeoutInMinutes = 0,
FrontendPort = 0,
Name = "string",
BackendAddressPoolId = "string",
EnableFloatingIp = false,
});
example, err := lb.NewNatRule(ctx, "natRuleResource", &lb.NatRuleArgs{
LoadbalancerId: pulumi.String("string"),
BackendPort: pulumi.Int(0),
ResourceGroupName: pulumi.String("string"),
Protocol: pulumi.String("string"),
FrontendIpConfigurationName: pulumi.String("string"),
EnableTcpReset: pulumi.Bool(false),
FrontendPortEnd: pulumi.Int(0),
FrontendPortStart: pulumi.Int(0),
IdleTimeoutInMinutes: pulumi.Int(0),
FrontendPort: pulumi.Int(0),
Name: pulumi.String("string"),
BackendAddressPoolId: pulumi.String("string"),
EnableFloatingIp: pulumi.Bool(false),
})
var natRuleResource = new NatRule("natRuleResource", NatRuleArgs.builder()
.loadbalancerId("string")
.backendPort(0)
.resourceGroupName("string")
.protocol("string")
.frontendIpConfigurationName("string")
.enableTcpReset(false)
.frontendPortEnd(0)
.frontendPortStart(0)
.idleTimeoutInMinutes(0)
.frontendPort(0)
.name("string")
.backendAddressPoolId("string")
.enableFloatingIp(false)
.build());
nat_rule_resource = azure.lb.NatRule("natRuleResource",
loadbalancer_id="string",
backend_port=0,
resource_group_name="string",
protocol="string",
frontend_ip_configuration_name="string",
enable_tcp_reset=False,
frontend_port_end=0,
frontend_port_start=0,
idle_timeout_in_minutes=0,
frontend_port=0,
name="string",
backend_address_pool_id="string",
enable_floating_ip=False)
const natRuleResource = new azure.lb.NatRule("natRuleResource", {
loadbalancerId: "string",
backendPort: 0,
resourceGroupName: "string",
protocol: "string",
frontendIpConfigurationName: "string",
enableTcpReset: false,
frontendPortEnd: 0,
frontendPortStart: 0,
idleTimeoutInMinutes: 0,
frontendPort: 0,
name: "string",
backendAddressPoolId: "string",
enableFloatingIp: false,
});
type: azure:lb:NatRule
properties:
backendAddressPoolId: string
backendPort: 0
enableFloatingIp: false
enableTcpReset: false
frontendIpConfigurationName: string
frontendPort: 0
frontendPortEnd: 0
frontendPortStart: 0
idleTimeoutInMinutes: 0
loadbalancerId: string
name: string
protocol: string
resourceGroupName: string
NatRule 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 NatRule resource accepts the following input properties:
- Backend
Port int - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- Frontend
Ip stringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- Loadbalancer
Id string - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- Protocol string
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - Resource
Group stringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- Backend
Address stringPool Id - Specifies a reference to backendAddressPool resource.
- 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
Port int - 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.
- Frontend
Port intEnd - 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.
- Frontend
Port intStart - 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.
- Idle
Timeout intIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - Name string
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- Backend
Port int - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- Frontend
Ip stringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- Loadbalancer
Id string - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- Protocol string
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - Resource
Group stringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- Backend
Address stringPool Id - Specifies a reference to backendAddressPool resource.
- 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
Port int - 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.
- Frontend
Port intEnd - 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.
- Frontend
Port intStart - 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.
- Idle
Timeout intIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - Name string
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- backend
Port Integer - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- frontend
Ip StringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- loadbalancer
Id String - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- protocol String
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource
Group StringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend
Address StringPool Id - Specifies a reference to backendAddressPool resource.
- enable
Floating 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
. - enable
Tcp BooleanReset - Is TCP Reset enabled for this Load Balancer Rule?
- frontend
Port Integer - 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.
- frontend
Port IntegerEnd - 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.
- frontend
Port IntegerStart - 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.
- idle
Timeout IntegerIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - name String
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- backend
Port number - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- frontend
Ip stringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- loadbalancer
Id string - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- protocol string
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource
Group stringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend
Address stringPool Id - Specifies a reference to backendAddressPool resource.
- enable
Floating 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
. - enable
Tcp booleanReset - Is TCP Reset enabled for this Load Balancer Rule?
- frontend
Port number - 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.
- frontend
Port numberEnd - 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.
- frontend
Port numberStart - 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.
- idle
Timeout numberIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - name string
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- backend_
port int - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- frontend_
ip_ strconfiguration_ name - The name of the frontend IP configuration exposing this rule.
- loadbalancer_
id str - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- protocol str
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource_
group_ strname - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend_
address_ strpool_ id - Specifies a reference to backendAddressPool resource.
- 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_
port int - 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.
- frontend_
port_ intend - 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.
- frontend_
port_ intstart - 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.
- idle_
timeout_ intin_ minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - name str
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- backend
Port Number - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- frontend
Ip StringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- loadbalancer
Id String - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- protocol String
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource
Group StringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend
Address StringPool Id - Specifies a reference to backendAddressPool resource.
- enable
Floating 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
. - enable
Tcp BooleanReset - Is TCP Reset enabled for this Load Balancer Rule?
- frontend
Port Number - 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.
- frontend
Port NumberEnd - 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.
- frontend
Port NumberStart - 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.
- idle
Timeout NumberIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - name String
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the NatRule resource produces the following output properties:
- Backend
Ip stringConfiguration Id - Frontend
Ip stringConfiguration Id - Id string
- The provider-assigned unique ID for this managed resource.
- Backend
Ip stringConfiguration Id - Frontend
Ip stringConfiguration Id - Id string
- The provider-assigned unique ID for this managed resource.
- backend
Ip StringConfiguration Id - frontend
Ip StringConfiguration Id - id String
- The provider-assigned unique ID for this managed resource.
- backend
Ip stringConfiguration Id - frontend
Ip stringConfiguration Id - id string
- The provider-assigned unique ID for this managed resource.
- backend_
ip_ strconfiguration_ id - frontend_
ip_ strconfiguration_ id - id str
- The provider-assigned unique ID for this managed resource.
- backend
Ip StringConfiguration Id - frontend
Ip StringConfiguration Id - id String
- The provider-assigned unique ID for this managed resource.
Look up Existing NatRule Resource
Get an existing NatRule 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?: NatRuleState, opts?: CustomResourceOptions): NatRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backend_address_pool_id: Optional[str] = None,
backend_ip_configuration_id: Optional[str] = None,
backend_port: Optional[int] = 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,
frontend_port_end: Optional[int] = None,
frontend_port_start: Optional[int] = None,
idle_timeout_in_minutes: Optional[int] = None,
loadbalancer_id: Optional[str] = None,
name: Optional[str] = None,
protocol: Optional[str] = None,
resource_group_name: Optional[str] = None) -> NatRule
func GetNatRule(ctx *Context, name string, id IDInput, state *NatRuleState, opts ...ResourceOption) (*NatRule, error)
public static NatRule Get(string name, Input<string> id, NatRuleState? state, CustomResourceOptions? opts = null)
public static NatRule get(String name, Output<String> id, NatRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Backend
Address stringPool Id - Specifies a reference to backendAddressPool resource.
- Backend
Ip stringConfiguration Id - Backend
Port int - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- 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 stringConfiguration Id - Frontend
Ip stringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- 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 1 and 65534, inclusive.
- Frontend
Port intEnd - 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.
- Frontend
Port intStart - 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.
- Idle
Timeout intIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - Loadbalancer
Id string - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- Protocol string
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - Resource
Group stringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- Backend
Address stringPool Id - Specifies a reference to backendAddressPool resource.
- Backend
Ip stringConfiguration Id - Backend
Port int - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- 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 stringConfiguration Id - Frontend
Ip stringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- 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 1 and 65534, inclusive.
- Frontend
Port intEnd - 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.
- Frontend
Port intStart - 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.
- Idle
Timeout intIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - Loadbalancer
Id string - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- Name string
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- Protocol string
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - Resource
Group stringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend
Address StringPool Id - Specifies a reference to backendAddressPool resource.
- backend
Ip StringConfiguration Id - backend
Port Integer - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- enable
Floating 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
. - enable
Tcp BooleanReset - Is TCP Reset enabled for this Load Balancer Rule?
- frontend
Ip StringConfiguration Id - frontend
Ip StringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- frontend
Port Integer - 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.
- frontend
Port IntegerEnd - 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.
- frontend
Port IntegerStart - 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.
- idle
Timeout IntegerIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - loadbalancer
Id String - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- name String
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- protocol String
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource
Group StringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend
Address stringPool Id - Specifies a reference to backendAddressPool resource.
- backend
Ip stringConfiguration Id - backend
Port number - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- enable
Floating 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
. - enable
Tcp booleanReset - Is TCP Reset enabled for this Load Balancer Rule?
- frontend
Ip stringConfiguration Id - frontend
Ip stringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- frontend
Port number - 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.
- frontend
Port numberEnd - 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.
- frontend
Port numberStart - 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.
- idle
Timeout numberIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - loadbalancer
Id string - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- name string
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- protocol string
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource
Group stringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend_
address_ strpool_ id - Specifies a reference to backendAddressPool resource.
- backend_
ip_ strconfiguration_ id - backend_
port int - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- 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 exposing this rule.
- 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 1 and 65534, inclusive.
- frontend_
port_ intend - 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.
- frontend_
port_ intstart - 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.
- idle_
timeout_ intin_ minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - loadbalancer_
id str - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- name str
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- protocol str
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource_
group_ strname - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
- backend
Address StringPool Id - Specifies a reference to backendAddressPool resource.
- backend
Ip StringConfiguration Id - backend
Port Number - The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
- enable
Floating 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
. - enable
Tcp BooleanReset - Is TCP Reset enabled for this Load Balancer Rule?
- frontend
Ip StringConfiguration Id - frontend
Ip StringConfiguration Name - The name of the frontend IP configuration exposing this rule.
- frontend
Port Number - 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.
- frontend
Port NumberEnd - 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.
- frontend
Port NumberStart - 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.
- idle
Timeout NumberIn Minutes - Specifies the idle timeout in minutes for TCP connections. Valid values are between
4
and30
minutes. Defaults to4
minutes. - loadbalancer
Id String - The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created.
- name String
- Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
- protocol String
- The transport protocol for the external endpoint. Possible values are
Udp
,Tcp
orAll
. - resource
Group StringName - The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
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
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
azurerm
Terraform Provider.