1. Packages
  2. Azure Classic
  3. API Docs
  4. lb
  5. NatRule

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.lb.NatRule

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    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:

    BackendPort int
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    FrontendIpConfigurationName string
    The name of the frontend IP configuration exposing this rule.
    LoadbalancerId 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 or All.
    ResourceGroupName string
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    BackendAddressPoolId string
    Specifies a reference to backendAddressPool resource.
    EnableFloatingIp bool
    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.
    EnableTcpReset bool
    Is TCP Reset enabled for this Load Balancer Rule?
    FrontendPort 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.
    FrontendPortEnd int
    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.
    FrontendPortStart int
    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.
    IdleTimeoutInMinutes int
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    Name string
    Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
    BackendPort int
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    FrontendIpConfigurationName string
    The name of the frontend IP configuration exposing this rule.
    LoadbalancerId 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 or All.
    ResourceGroupName string
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    BackendAddressPoolId string
    Specifies a reference to backendAddressPool resource.
    EnableFloatingIp bool
    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.
    EnableTcpReset bool
    Is TCP Reset enabled for this Load Balancer Rule?
    FrontendPort 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.
    FrontendPortEnd int
    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.
    FrontendPortStart int
    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.
    IdleTimeoutInMinutes int
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    Name string
    Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
    backendPort Integer
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    frontendIpConfigurationName String
    The name of the frontend IP configuration exposing this rule.
    loadbalancerId 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 or All.
    resourceGroupName String
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backendAddressPoolId String
    Specifies a reference to backendAddressPool resource.
    enableFloatingIp Boolean
    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.
    enableTcpReset Boolean
    Is TCP Reset enabled for this Load Balancer Rule?
    frontendPort 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.
    frontendPortEnd Integer
    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.
    frontendPortStart Integer
    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.
    idleTimeoutInMinutes Integer
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    name String
    Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
    backendPort number
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    frontendIpConfigurationName string
    The name of the frontend IP configuration exposing this rule.
    loadbalancerId 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 or All.
    resourceGroupName string
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backendAddressPoolId string
    Specifies a reference to backendAddressPool resource.
    enableFloatingIp boolean
    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.
    enableTcpReset boolean
    Is TCP Reset enabled for this Load Balancer Rule?
    frontendPort 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.
    frontendPortEnd number
    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.
    frontendPortStart number
    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.
    idleTimeoutInMinutes number
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 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_configuration_name str
    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 or All.
    resource_group_name str
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backend_address_pool_id str
    Specifies a reference to backendAddressPool resource.
    enable_floating_ip bool
    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_reset bool
    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_end int
    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_start int
    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_in_minutes int
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    name str
    Specifies the name of the NAT Rule. Changing this forces a new resource to be created.
    backendPort Number
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    frontendIpConfigurationName String
    The name of the frontend IP configuration exposing this rule.
    loadbalancerId 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 or All.
    resourceGroupName String
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backendAddressPoolId String
    Specifies a reference to backendAddressPool resource.
    enableFloatingIp Boolean
    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.
    enableTcpReset Boolean
    Is TCP Reset enabled for this Load Balancer Rule?
    frontendPort 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.
    frontendPortEnd Number
    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.
    frontendPortStart Number
    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.
    idleTimeoutInMinutes Number
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 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:

    BackendIpConfigurationId string
    FrontendIpConfigurationId string
    Id string
    The provider-assigned unique ID for this managed resource.
    BackendIpConfigurationId string
    FrontendIpConfigurationId string
    Id string
    The provider-assigned unique ID for this managed resource.
    backendIpConfigurationId String
    frontendIpConfigurationId String
    id String
    The provider-assigned unique ID for this managed resource.
    backendIpConfigurationId string
    frontendIpConfigurationId string
    id string
    The provider-assigned unique ID for this managed resource.
    backend_ip_configuration_id str
    frontend_ip_configuration_id str
    id str
    The provider-assigned unique ID for this managed resource.
    backendIpConfigurationId String
    frontendIpConfigurationId String
    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.
    The following state arguments are supported:
    BackendAddressPoolId string
    Specifies a reference to backendAddressPool resource.
    BackendIpConfigurationId string
    BackendPort int
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    EnableFloatingIp bool
    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.
    EnableTcpReset bool
    Is TCP Reset enabled for this Load Balancer Rule?
    FrontendIpConfigurationId string
    FrontendIpConfigurationName string
    The name of the frontend IP configuration exposing this rule.
    FrontendPort 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.
    FrontendPortEnd int
    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.
    FrontendPortStart int
    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.
    IdleTimeoutInMinutes int
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    LoadbalancerId 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 or All.
    ResourceGroupName string
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    BackendAddressPoolId string
    Specifies a reference to backendAddressPool resource.
    BackendIpConfigurationId string
    BackendPort int
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    EnableFloatingIp bool
    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.
    EnableTcpReset bool
    Is TCP Reset enabled for this Load Balancer Rule?
    FrontendIpConfigurationId string
    FrontendIpConfigurationName string
    The name of the frontend IP configuration exposing this rule.
    FrontendPort 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.
    FrontendPortEnd int
    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.
    FrontendPortStart int
    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.
    IdleTimeoutInMinutes int
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    LoadbalancerId 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 or All.
    ResourceGroupName string
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backendAddressPoolId String
    Specifies a reference to backendAddressPool resource.
    backendIpConfigurationId String
    backendPort Integer
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    enableFloatingIp Boolean
    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.
    enableTcpReset Boolean
    Is TCP Reset enabled for this Load Balancer Rule?
    frontendIpConfigurationId String
    frontendIpConfigurationName String
    The name of the frontend IP configuration exposing this rule.
    frontendPort 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.
    frontendPortEnd Integer
    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.
    frontendPortStart Integer
    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.
    idleTimeoutInMinutes Integer
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    loadbalancerId 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 or All.
    resourceGroupName String
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backendAddressPoolId string
    Specifies a reference to backendAddressPool resource.
    backendIpConfigurationId string
    backendPort number
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    enableFloatingIp boolean
    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.
    enableTcpReset boolean
    Is TCP Reset enabled for this Load Balancer Rule?
    frontendIpConfigurationId string
    frontendIpConfigurationName string
    The name of the frontend IP configuration exposing this rule.
    frontendPort 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.
    frontendPortEnd number
    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.
    frontendPortStart number
    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.
    idleTimeoutInMinutes number
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    loadbalancerId 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 or All.
    resourceGroupName string
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backend_address_pool_id str
    Specifies a reference to backendAddressPool resource.
    backend_ip_configuration_id str
    backend_port int
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    enable_floating_ip bool
    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_reset bool
    Is TCP Reset enabled for this Load Balancer Rule?
    frontend_ip_configuration_id str
    frontend_ip_configuration_name str
    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_end int
    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_start int
    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_in_minutes int
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 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 or All.
    resource_group_name str
    The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
    backendAddressPoolId String
    Specifies a reference to backendAddressPool resource.
    backendIpConfigurationId String
    backendPort Number
    The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    enableFloatingIp Boolean
    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.
    enableTcpReset Boolean
    Is TCP Reset enabled for this Load Balancer Rule?
    frontendIpConfigurationId String
    frontendIpConfigurationName String
    The name of the frontend IP configuration exposing this rule.
    frontendPort 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.
    frontendPortEnd Number
    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.
    frontendPortStart Number
    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.
    idleTimeoutInMinutes Number
    Specifies the idle timeout in minutes for TCP connections. Valid values are between 4 and 30 minutes. Defaults to 4 minutes.
    loadbalancerId 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 or All.
    resourceGroupName String
    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.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi