» azurerm_lb_outbound_rule

Manages a Load Balancer Outbound Rule.

» Example Usage

resource "azurerm_resource_group" "test" {
  name     = "LoadBalancerRG"
  location = "West US"
}

resource "azurerm_public_ip" "test" {
  name                         = "PublicIPForLB"
  location                     = "West US"
  resource_group_name          = "${azurerm_resource_group.test.name}"
  allocation_method            = "Static"
}

resource "azurerm_lb" "test" {
  name                = "TestLoadBalancer"
  location            = "West US"
  resource_group_name = "${azurerm_resource_group.test.name}"

  frontend_ip_configuration {
    name                 = "PublicIPAddress"
    public_ip_address_id = "${azurerm_public_ip.test.id}"
  }
}

resource "azurerm_lb_backend_address_pool" "test" {
  resource_group_name = "${azurerm_resource_group.test.name}"
  loadbalancer_id     = "${azurerm_lb.test.id}"
  name                = "be-%d"
}

resource "azurerm_lb_outbound_rule" "test" {
  resource_group_name            = "${azurerm_resource_group.test.name}"
  loadbalancer_id                = "${azurerm_lb.test.id}"
  name                           = "OutboundRule"
  protocol                       = "Tcp"
  backend_address_pool_id        = "${azurerm_lb_backend_address_pool.test.id}"

  frontend_ip_configuration {
    name = "PublicIPAddress"
  }
}

» Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Outbound Rule. Changing this forces a new resource to be created.
  • resource_group_name - (Required) The name of the resource group in which to create the resource. Changing this forces a new resource to be created.
  • loadbalancer_id - (Required) The ID of the Load Balancer in which to create the Outbound Rule. Changing this forces a new resource to be created.
  • frontend_ip_configuration - (Required) One or more frontend_ip_configuration blocks as defined below.
  • backend_address_pool_id - (Required) The ID of the Backend Address Pool. Outbound traffic is randomly load balanced across IPs in the backend IPs.
  • protocol - (Required) The transport protocol for the external endpoint. Possible values are Udp, Tcp or All.
  • enable_tcp_reset - (Optional) Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.
  • allocated_outbound_ports - (Optional) The number of outbound ports to be used for NAT.
  • idle_timeout_in_minutes - (Optional) The timeout for the TCP idle connection

A frontend_ip_configuration block supports the following:

  • name - (Required) The name of the Frontend IP Configuration.

» Attributes Reference

The following attributes are exported:

  • id - The ID of the Load Balancer to which the resource is attached.

» Import

Load Balancer Outbound Rules can be imported using the resource id, e.g.

terraform import azurerm_lb_outbound_rule.test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/outboundRules/rule1