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