import * as pulumi from "@pulumi/pulumi"; /** * Manages a Load Balancer Rule. * * > **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 exampleRule = new azure.lb.Rule("example", { * loadbalancerId: exampleLoadBalancer.id, * name: "LBRule", * protocol: "Tcp", * frontendPort: 3389, * backendPort: 3389, * frontendIpConfigurationName: "PublicIPAddress", * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Network` - 2023-09-01 * * ## Import * * Load Balancer Rules can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:lb/rule:Rule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/loadBalancingRules/rule1 * ``` */ export declare class Rule extends pulumi.CustomResource { /** * Get an existing Rule 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?: RuleState, opts?: pulumi.CustomResourceOptions): Rule; /** * Returns true if the given object is an instance of Rule. 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 Rule; /** * A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. * * > **Note:** In most cases users can only set one Backend Address Pool ID in the `backendAddressPoolIds`. Especially, when the sku of the LB is `Gateway`, users can set up to two IDs in the `backendAddressPoolIds`. */ readonly backendAddressPoolIds: pulumi.Output; /** * The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of `0` means "Any Port". */ readonly backendPort: pulumi.Output; /** * Is snat enabled for this Load Balancer Rule? Default `false`. */ readonly disableOutboundSnat: 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 to which the rule is associated. */ 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 0 and 65534, inclusive. A port of `0` means "Any Port". */ readonly frontendPort: pulumi.Output; /** * Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `100` minutes. Defaults to `4` minutes. */ readonly idleTimeoutInMinutes: pulumi.Output; /** * Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are `Default`, `SourceIP` and `SourceIPProtocol`. Defaults to `Default.` * * `Default` – The load balancer is configured to use a 5 tuple hash to map traffic to available servers. * * `SourceIP` – The load balancer is configured to use a 2 tuple hash to map traffic to available servers. * * `SourceIPProtocol` – The load balancer is configured to use a 3 tuple hash to map traffic to available servers. * * > **Note:** In the portal, this is known as Session Persistence where the options are `None`, `Client IP` and `Client IP and Protocol` respectively. */ readonly loadDistribution: pulumi.Output; /** * The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created. */ readonly loadbalancerId: pulumi.Output; /** * Specifies the name of the LB Rule. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * A reference to a Probe used by this Load Balancing Rule. */ readonly probeId: pulumi.Output; /** * The transport protocol for the external endpoint. Possible values are `Tcp`, `Udp` or `All`. */ readonly protocol: pulumi.Output; /** * Is TCP Reset enabled for this Load Balancer Rule? */ readonly tcpResetEnabled: pulumi.Output; /** * Create a Rule 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: RuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Rule resources. */ export interface RuleState { /** * A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. * * > **Note:** In most cases users can only set one Backend Address Pool ID in the `backendAddressPoolIds`. Especially, when the sku of the LB is `Gateway`, users can set up to two IDs in the `backendAddressPoolIds`. */ backendAddressPoolIds?: pulumi.Input[]>; /** * The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of `0` means "Any Port". */ backendPort?: pulumi.Input; /** * Is snat enabled for this Load Balancer Rule? Default `false`. */ disableOutboundSnat?: 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 to which the rule is associated. */ 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 0 and 65534, inclusive. A port of `0` means "Any Port". */ frontendPort?: pulumi.Input; /** * Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `100` minutes. Defaults to `4` minutes. */ idleTimeoutInMinutes?: pulumi.Input; /** * Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are `Default`, `SourceIP` and `SourceIPProtocol`. Defaults to `Default.` * * `Default` – The load balancer is configured to use a 5 tuple hash to map traffic to available servers. * * `SourceIP` – The load balancer is configured to use a 2 tuple hash to map traffic to available servers. * * `SourceIPProtocol` – The load balancer is configured to use a 3 tuple hash to map traffic to available servers. * * > **Note:** In the portal, this is known as Session Persistence where the options are `None`, `Client IP` and `Client IP and Protocol` respectively. */ loadDistribution?: pulumi.Input; /** * The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created. */ loadbalancerId?: pulumi.Input; /** * Specifies the name of the LB Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * A reference to a Probe used by this Load Balancing Rule. */ probeId?: pulumi.Input; /** * The transport protocol for the external endpoint. Possible values are `Tcp`, `Udp` or `All`. */ protocol?: pulumi.Input; /** * Is TCP Reset enabled for this Load Balancer Rule? */ tcpResetEnabled?: pulumi.Input; } /** * The set of arguments for constructing a Rule resource. */ export interface RuleArgs { /** * A list of reference to a Backend Address Pool over which this Load Balancing Rule operates. * * > **Note:** In most cases users can only set one Backend Address Pool ID in the `backendAddressPoolIds`. Especially, when the sku of the LB is `Gateway`, users can set up to two IDs in the `backendAddressPoolIds`. */ backendAddressPoolIds?: pulumi.Input[]>; /** * The port used for internal connections on the endpoint. Possible values range between 0 and 65535, inclusive. A port of `0` means "Any Port". */ backendPort: pulumi.Input; /** * Is snat enabled for this Load Balancer Rule? Default `false`. */ disableOutboundSnat?: 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 to which the rule is associated. */ 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 0 and 65534, inclusive. A port of `0` means "Any Port". */ frontendPort: pulumi.Input; /** * Specifies the idle timeout in minutes for TCP connections. Valid values are between `4` and `100` minutes. Defaults to `4` minutes. */ idleTimeoutInMinutes?: pulumi.Input; /** * Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are `Default`, `SourceIP` and `SourceIPProtocol`. Defaults to `Default.` * * `Default` – The load balancer is configured to use a 5 tuple hash to map traffic to available servers. * * `SourceIP` – The load balancer is configured to use a 2 tuple hash to map traffic to available servers. * * `SourceIPProtocol` – The load balancer is configured to use a 3 tuple hash to map traffic to available servers. * * > **Note:** In the portal, this is known as Session Persistence where the options are `None`, `Client IP` and `Client IP and Protocol` respectively. */ loadDistribution?: pulumi.Input; /** * The ID of the Load Balancer in which to create the Rule. Changing this forces a new resource to be created. */ loadbalancerId: pulumi.Input; /** * Specifies the name of the LB Rule. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * A reference to a Probe used by this Load Balancing Rule. */ probeId?: pulumi.Input; /** * The transport protocol for the external endpoint. Possible values are `Tcp`, `Udp` or `All`. */ protocol: pulumi.Input; /** * Is TCP Reset enabled for this Load Balancer Rule? */ tcpResetEnabled?: pulumi.Input; }