github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/website/source/docs/providers/openstack/r/lb_pool_v1.html.markdown (about)

     1  ---
     2  layout: "openstack"
     3  page_title: "OpenStack: openstack_lb_pool_v1"
     4  sidebar_current: "docs-openstack-resource-lb-pool-v1"
     5  description: |-
     6    Manages a V1 load balancer pool resource within OpenStack.
     7  ---
     8  
     9  # openstack\_lb\_pool_v1
    10  
    11  Manages a V1 load balancer pool resource within OpenStack.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "openstack_lb_pool_v1" "pool_1" {
    17    name = "tf_test_lb_pool"
    18    protocol = "HTTP"
    19    subnet_id = "12345"
    20    lb_method = "ROUND_ROBIN"
    21    lb_provider = "haproxy"
    22    monitor_ids = ["67890"]
    23  }
    24  ```
    25  
    26  ## Complete Load Balancing Stack Example
    27  
    28  ```
    29  resource "openstack_networking_network_v2" "network_1" {
    30    name = "network_1"
    31    admin_state_up = "true"
    32  }
    33  
    34  resource "openstack_networking_subnet_v2" "subnet_1" {
    35    network_id = "${openstack_networking_network_v2.network_1.id}"
    36    cidr = "192.168.199.0/24"
    37    ip_version = 4
    38  }
    39  
    40  resource "openstack_compute_secgroup_v2" "secgroup_1" {
    41    name = "secgroup_1"
    42    description = "Rules for secgroup_1"
    43  
    44    rule {
    45      from_port = -1
    46      to_port = -1
    47      ip_protocol = "icmp"
    48      cidr = "0.0.0.0/0"
    49    }
    50  
    51    rule {
    52      from_port = 80
    53      to_port = 80
    54      ip_protocol = "tcp"
    55      cidr = "0.0.0.0/0"
    56    }
    57  }
    58  
    59  resource "openstack_compute_instance_v2" "instance_1" {
    60    name = "instance_1"
    61    security_groups = ["default", "${openstack_compute_secgroup_v2.secgroup_1.name}"]
    62    network {
    63      uuid = "${openstack_networking_network_v2.network_1.id}"
    64    }
    65  }
    66  
    67  resource "openstack_compute_instance_v2" "instance_2" {
    68    name = "instance_2"
    69    security_groups = ["default", "${openstack_compute_secgroup_v2.secgroup_1.name}"]
    70    network {
    71      uuid = "${openstack_networking_network_v2.network_1.id}"
    72    }
    73  }
    74  
    75  resource "openstack_lb_monitor_v1" "monitor_1" {
    76    type = "TCP"
    77    delay = 30
    78    timeout = 5
    79    max_retries = 3
    80    admin_state_up = "true"
    81  }
    82  
    83  resource "openstack_lb_pool_v1" "pool_1" {
    84    name = "pool_1"
    85    protocol = "TCP"
    86    subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
    87    lb_method = "ROUND_ROBIN"
    88    monitor_ids = ["${openstack_lb_monitor_v1.monitor_1.id}"]
    89  }
    90  
    91  resource "openstack_lb_member_v1" "member_1" {
    92    pool_id = "${openstack_lb_pool_v1.pool_1.id}"
    93    address = "${openstack_compute_instance_v2.instance_1.access_ip_v4}"
    94    port = 80
    95  }
    96  
    97  resource "openstack_lb_member_v1" "member_2" {
    98    pool_id = "${openstack_lb_pool_v1.pool_1.id}"
    99    address = "${openstack_compute_instance_v2.instance_2.access_ip_v4}"
   100    port = 80
   101  }
   102  
   103  resource "openstack_lb_vip_v1" "vip_1" {
   104    name = "vip_1"
   105    subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
   106    protocol = "TCP"
   107    port = 80
   108    pool_id = "${openstack_lb_pool_v1.pool_1.id}"
   109  }
   110  ```
   111  
   112  ## Argument Reference
   113  
   114  The following arguments are supported:
   115  
   116  * `region` - (Required) The region in which to obtain the V2 Networking client.
   117      A Networking client is needed to create an LB pool. If omitted, the
   118      `OS_REGION_NAME` environment variable is used. Changing this creates a new
   119      LB pool.
   120  
   121  * `name` - (Required) The name of the pool. Changing this updates the name of
   122      the existing pool.
   123  
   124  * `protocol` - (Required)  The protocol used by the pool members, you can use
   125    either 'TCP, 'HTTP', or 'HTTPS'. Changing this creates a new pool.
   126  
   127  * `subnet_id` - (Required) The network on which the members of the pool will be
   128      located. Only members that are on this network can be added to the pool.
   129      Changing this creates a new pool.
   130  
   131  * `lb_method` - (Required) The algorithm used to distribute load between the
   132      members of the pool. The current specification supports 'ROUND_ROBIN' and
   133      'LEAST_CONNECTIONS' as valid values for this attribute.
   134  
   135  * `lb_provider` - (Optional) The backend load balancing provider. For example:
   136      `haproxy`, `F5`, etc.
   137  
   138  * `tenant_id` - (Optional) The owner of the pool. Required if admin wants to
   139      create a pool member for another tenant. Changing this creates a new pool.
   140  
   141  * `monitor_ids` - (Optional) A list of IDs of monitors to associate with the
   142      pool.
   143  
   144  * `member` - (Optional) An existing node to add to the pool. Changing this
   145      updates the members of the pool. The member object structure is documented
   146      below. Please note that the `member` block is deprecated in favor of the
   147      `openstack_lb_member_v1` resource.
   148  
   149  The `member` block supports:
   150  
   151  * `address` - (Required) The IP address of the member. Changing this creates a
   152  new member.
   153  
   154  * `port` - (Required) An integer representing the port on which the member is
   155  hosted. Changing this creates a new member.
   156  
   157  * `admin_state_up` - (Required) The administrative state of the member.
   158  Acceptable values are 'true' and 'false'. Changing this value updates the
   159  state of the existing member.
   160  
   161  * `tenant_id` - (Optional) The owner of the member. Required if admin wants to
   162  create a pool member for another tenant. Changing this creates a new member.
   163  
   164  ## Attributes Reference
   165  
   166  The following attributes are exported:
   167  
   168  * `region` - See Argument Reference above.
   169  * `name` - See Argument Reference above.
   170  * `protocol` - See Argument Reference above.
   171  * `subnet_id` - See Argument Reference above.
   172  * `lb_method` - See Argument Reference above.
   173  * `lb_provider` - See Argument Reference above.
   174  * `tenant_id` - See Argument Reference above.
   175  * `monitor_id` - See Argument Reference above.
   176  * `member` - See Argument Reference above.
   177  
   178  ## Notes
   179  
   180  The `member` block is deprecated in favor of the `openstack_lb_member_v1` resource.