github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    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  
    63    network {
    64      uuid = "${openstack_networking_network_v2.network_1.id}"
    65    }
    66  }
    67  
    68  resource "openstack_compute_instance_v2" "instance_2" {
    69    name            = "instance_2"
    70    security_groups = ["default", "${openstack_compute_secgroup_v2.secgroup_1.name}"]
    71  
    72    network {
    73      uuid = "${openstack_networking_network_v2.network_1.id}"
    74    }
    75  }
    76  
    77  resource "openstack_lb_monitor_v1" "monitor_1" {
    78    type           = "TCP"
    79    delay          = 30
    80    timeout        = 5
    81    max_retries    = 3
    82    admin_state_up = "true"
    83  }
    84  
    85  resource "openstack_lb_pool_v1" "pool_1" {
    86    name        = "pool_1"
    87    protocol    = "TCP"
    88    subnet_id   = "${openstack_networking_subnet_v2.subnet_1.id}"
    89    lb_method   = "ROUND_ROBIN"
    90    monitor_ids = ["${openstack_lb_monitor_v1.monitor_1.id}"]
    91  }
    92  
    93  resource "openstack_lb_member_v1" "member_1" {
    94    pool_id = "${openstack_lb_pool_v1.pool_1.id}"
    95    address = "${openstack_compute_instance_v2.instance_1.access_ip_v4}"
    96    port    = 80
    97  }
    98  
    99  resource "openstack_lb_member_v1" "member_2" {
   100    pool_id = "${openstack_lb_pool_v1.pool_1.id}"
   101    address = "${openstack_compute_instance_v2.instance_2.access_ip_v4}"
   102    port    = 80
   103  }
   104  
   105  resource "openstack_lb_vip_v1" "vip_1" {
   106    name      = "vip_1"
   107    subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
   108    protocol  = "TCP"
   109    port      = 80
   110    pool_id   = "${openstack_lb_pool_v1.pool_1.id}"
   111  }
   112  ```
   113  
   114  ## Argument Reference
   115  
   116  The following arguments are supported:
   117  
   118  * `region` - (Required) The region in which to obtain the V2 Networking client.
   119      A Networking client is needed to create an LB pool. If omitted, the
   120      `OS_REGION_NAME` environment variable is used. Changing this creates a new
   121      LB pool.
   122  
   123  * `name` - (Required) The name of the pool. Changing this updates the name of
   124      the existing pool.
   125  
   126  * `protocol` - (Required)  The protocol used by the pool members, you can use
   127    either 'TCP, 'HTTP', or 'HTTPS'. Changing this creates a new pool.
   128  
   129  * `subnet_id` - (Required) The network on which the members of the pool will be
   130      located. Only members that are on this network can be added to the pool.
   131      Changing this creates a new pool.
   132  
   133  * `lb_method` - (Required) The algorithm used to distribute load between the
   134      members of the pool. The current specification supports 'ROUND_ROBIN' and
   135      'LEAST_CONNECTIONS' as valid values for this attribute.
   136  
   137  * `lb_provider` - (Optional) The backend load balancing provider. For example:
   138      `haproxy`, `F5`, etc.
   139  
   140  * `tenant_id` - (Optional) The owner of the pool. Required if admin wants to
   141      create a pool member for another tenant. Changing this creates a new pool.
   142  
   143  * `monitor_ids` - (Optional) A list of IDs of monitors to associate with the
   144      pool.
   145  
   146  * `member` - (Optional) An existing node to add to the pool. Changing this
   147      updates the members of the pool. The member object structure is documented
   148      below. Please note that the `member` block is deprecated in favor of the
   149      `openstack_lb_member_v1` resource.
   150  
   151  The `member` block supports:
   152  
   153  * `address` - (Required) The IP address of the member. Changing this creates a
   154  new member.
   155  
   156  * `port` - (Required) An integer representing the port on which the member is
   157  hosted. Changing this creates a new member.
   158  
   159  * `admin_state_up` - (Required) The administrative state of the member.
   160  Acceptable values are 'true' and 'false'. Changing this value updates the
   161  state of the existing member.
   162  
   163  * `tenant_id` - (Optional) The owner of the member. Required if admin wants to
   164  create a pool member for another tenant. Changing this creates a new member.
   165  
   166  ## Attributes Reference
   167  
   168  The following attributes are exported:
   169  
   170  * `region` - See Argument Reference above.
   171  * `name` - See Argument Reference above.
   172  * `protocol` - See Argument Reference above.
   173  * `subnet_id` - See Argument Reference above.
   174  * `lb_method` - See Argument Reference above.
   175  * `lb_provider` - See Argument Reference above.
   176  * `tenant_id` - See Argument Reference above.
   177  * `monitor_id` - See Argument Reference above.
   178  * `member` - See Argument Reference above.
   179  
   180  ## Notes
   181  
   182  The `member` block is deprecated in favor of the `openstack_lb_member_v1` resource.
   183  
   184  ## Import
   185  
   186  Load Balancer Pools can be imported using the `id`, e.g.
   187  
   188  ```
   189  $ terraform import openstack_lb_pool_v1.pool_1 b255e6ba-02ad-43e6-8951-3428ca26b713
   190  ```