import * as pulumi from "@pulumi/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 * * ```typescript * 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", * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Network` - 2023-09-01 * * ## Import * * Load Balancer NAT Rules can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:lb/natRule:NatRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/inboundNatRules/rule1 * ``` */ export declare class NatRule extends pulumi.CustomResource { /** * Get an existing NatRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: NatRuleState, opts?: pulumi.CustomResourceOptions): NatRule; /** * Returns true if the given object is an instance of NatRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is NatRule; /** * Specifies a reference to backendAddressPool resource. */ readonly backendAddressPoolId: pulumi.Output; readonly backendIpConfigurationId: pulumi.Output; /** * The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive. */ readonly backendPort: pulumi.Output; /** * @deprecated This field is deprecated in favour of `floatingIpEnabled` and will be removed in version 5.0 of the provider. */ readonly enableFloatingIp: pulumi.Output; /** * @deprecated This field is deprecated in favour of `tcpResetEnabled` and will be removed in version 5.0 of the provider. */ readonly enableTcpReset: pulumi.Output; /** * 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`. */ readonly floatingIpEnabled: pulumi.Output; readonly frontendIpConfigurationId: pulumi.Output; /** * The name of the frontend IP configuration exposing this rule. */ readonly frontendIpConfigurationName: pulumi.Output; /** * 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. */ readonly frontendPort: pulumi.Output; /** * 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. */ readonly frontendPortEnd: pulumi.Output; /** * 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. */ readonly frontendPortStart: pulumi.Output; /** * Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `30` minutes. Defaults to `4` minutes. */ readonly idleTimeoutInMinutes: pulumi.Output; /** * The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created. */ readonly loadbalancerId: pulumi.Output; /** * Specifies the name of the NAT Rule. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * The transport protocol for the external endpoint. Possible values are `Udp`, `Tcp` or `All`. */ readonly protocol: pulumi.Output; /** * The name of the resource group in which to create the resource. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * Is TCP Reset enabled for this Load Balancer Rule? */ readonly tcpResetEnabled: pulumi.Output; /** * Create a NatRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: NatRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering NatRule resources. */ export interface NatRuleState { /** * Specifies a reference to backendAddressPool resource. */ backendAddressPoolId?: pulumi.Input; backendIpConfigurationId?: pulumi.Input; /** * The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive. */ backendPort?: pulumi.Input; /** * @deprecated This field is deprecated in favour of `floatingIpEnabled` and will be removed in version 5.0 of the provider. */ enableFloatingIp?: pulumi.Input; /** * @deprecated This field is deprecated in favour of `tcpResetEnabled` and will be removed in version 5.0 of the provider. */ enableTcpReset?: pulumi.Input; /** * 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`. */ floatingIpEnabled?: pulumi.Input; frontendIpConfigurationId?: pulumi.Input; /** * The name of the frontend IP configuration exposing this rule. */ frontendIpConfigurationName?: pulumi.Input; /** * 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. */ frontendPort?: pulumi.Input; /** * 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. */ frontendPortEnd?: pulumi.Input; /** * 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. */ frontendPortStart?: pulumi.Input; /** * Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `30` minutes. Defaults to `4` minutes. */ idleTimeoutInMinutes?: pulumi.Input; /** * The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created. */ loadbalancerId?: pulumi.Input; /** * Specifies the name of the NAT Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The transport protocol for the external endpoint. Possible values are `Udp`, `Tcp` or `All`. */ protocol?: pulumi.Input; /** * The name of the resource group in which to create the resource. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * Is TCP Reset enabled for this Load Balancer Rule? */ tcpResetEnabled?: pulumi.Input; } /** * The set of arguments for constructing a NatRule resource. */ export interface NatRuleArgs { /** * Specifies a reference to backendAddressPool resource. */ backendAddressPoolId?: pulumi.Input; /** * The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive. */ backendPort: pulumi.Input; /** * @deprecated This field is deprecated in favour of `floatingIpEnabled` and will be removed in version 5.0 of the provider. */ enableFloatingIp?: pulumi.Input; /** * @deprecated This field is deprecated in favour of `tcpResetEnabled` and will be removed in version 5.0 of the provider. */ enableTcpReset?: pulumi.Input; /** * 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`. */ floatingIpEnabled?: pulumi.Input; /** * The name of the frontend IP configuration exposing this rule. */ frontendIpConfigurationName: pulumi.Input; /** * 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. */ frontendPort?: pulumi.Input; /** * 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. */ frontendPortEnd?: pulumi.Input; /** * 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. */ frontendPortStart?: pulumi.Input; /** * Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `30` minutes. Defaults to `4` minutes. */ idleTimeoutInMinutes?: pulumi.Input; /** * The ID of the Load Balancer in which to create the NAT Rule. Changing this forces a new resource to be created. */ loadbalancerId: pulumi.Input; /** * Specifies the name of the NAT Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * The transport protocol for the external endpoint. Possible values are `Udp`, `Tcp` or `All`. */ protocol: pulumi.Input; /** * The name of the resource group in which to create the resource. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * Is TCP Reset enabled for this Load Balancer Rule? */ tcpResetEnabled?: pulumi.Input; }