github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/azurerm/r/loadbalancer_rule.html.markdown (about)

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_lb_rule"
     4  sidebar_current: "docs-azurerm-resource-loadbalancer-rule"
     5  description: |-
     6    Create a LoadBalancer Rule.
     7  ---
     8  
     9  # azurerm\_lb\_rule
    10  
    11  Create a LoadBalancer Rule.
    12  
    13  ~> **NOTE When using this resource, the LoadBalancer needs to have a FrontEnd IP Configuration Attached
    14  
    15  ## Example Usage
    16  
    17  ```
    18  resource "azurerm_resource_group" "test" {
    19      name = "LoadBalancerRG"
    20      location = "West US"
    21  }
    22  
    23  resource "azurerm_public_ip" "test" {
    24      name = "PublicIPForLB"
    25      location = "West US"
    26      resource_group_name = "${azurerm_resource_group.test.name}"
    27      public_ip_address_allocation = "static"
    28  }
    29  
    30  resource "azurerm_lb" "test" {
    31      name = "TestLoadBalancer"
    32      location = "West US"
    33      resource_group_name = "${azurerm_resource_group.test.name}"
    34  
    35      frontend_ip_configuration {
    36        name = "PublicIPAddress"
    37        public_ip_address_id = "${azurerm_public_ip.test.id}"
    38      }
    39  }
    40  
    41  resource "azurerm_lb_rule" "test" {
    42    location = "West US"
    43    resource_group_name = "${azurerm_resource_group.test.name}"
    44    loadbalancer_id = "${azurerm_lb.test.id}"
    45    name = "LBRule"
    46    protocol = "Tcp"
    47    frontend_port = 3389
    48    backend_port = 3389
    49    frontend_ip_configuration_name = "PublicIPAddress"
    50  }
    51  ```
    52  
    53  ## Argument Reference
    54  
    55  The following arguments are supported:
    56  
    57  * `name` - (Required) Specifies the name of the LB Rule.
    58  * `resource_group_name` - (Required) The name of the resource group in which to create the resource.
    59  * `location` - (Required) Specifies the supported Azure location where the resource exists.
    60  * `loadbalancer_id` - (Required) The ID of the LoadBalancer in which to create the Rule.
    61  * `frontend_ip_configuration_name` - (Required) The name of the frontend IP configuration to which the rule is associated.
    62  * `protocol` - (Required) The transport protocol for the external endpoint. Possible values are `Udp` or `Tcp`. 
    63  * `frontend_port` - (Required) 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.
    64  * `backend_port` - (Required) The port used for internal connections on the endpoint. Possible values range between 1 and 65535, inclusive.
    65  * `backend_address_pool_id` - (Optional) A reference to a Backend Address Pool over which this Load Balancing Rule operates.
    66  * `probe_id` - (Optional) A reference to a Probe used by this Load Balancing Rule.
    67  * `enable_floating_ip` - (Optional) Floating IP is pertinent to failover scenarios: a “floating” IP is reassigned to a secondary server in case the primary server fails. Floating IP is required for SQL AlwaysOn.
    68  * `idle_timeout_in_minutes` - (Optional) Specifies the timeout for the Tcp idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to Tcp.
    69  * `load_distribution` - (Optional) Specifies the load balancing distribution type to be used by the Load Balancer. Possible values are: 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.
    70  
    71  ## Attributes Reference
    72  
    73  The following attributes are exported:
    74  
    75  * `id` - The ID of the LoadBalancer to which the resource is attached.