Skip to content

Commit af7b6b1

Browse files
GCLOUD2-13375: Enhanced load balancer docs (#77)
* GCLOUD2-13375: Enhanced load balancer docs
1 parent b9a8dfd commit af7b6b1

File tree

92 files changed

+1813
-745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1813
-745
lines changed

docs/data-sources/lblistener.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,24 @@ provider gcore {
1717
permanent_api_token = "251$d3361.............1b35f26d8"
1818
}
1919
20-
data "gcore_project" "pr" {
21-
name = "test"
20+
data "gcore_project" "project" {
21+
name = "Default"
2222
}
2323
24-
data "gcore_region" "rg" {
25-
name = "ED-10 Preprod"
24+
data "gcore_region" "region" {
25+
name = "Luxembourg-2"
2626
}
2727
28-
data "gcore_lblistener" "l" {
28+
data "gcore_lblistener" "listener" {
29+
region_id = data.gcore_region.region.id
30+
project_id = data.gcore_project.project.id
31+
2932
name = "test-listener"
30-
loadbalancer_id = "59b2eabc-c0a8-4545-8081-979bd963c6ab" //optional
31-
region_id = data.gcore_region.rg.id
32-
project_id = data.gcore_project.pr.id
33+
// loadbalancer_id = gcore.loadbalancer_v2.lb.id
3334
}
3435
3536
output "view" {
36-
value = data.gcore_lblistener.l
37+
value = data.gcore_lblistener.listener
3738
}
3839
```
3940

@@ -42,25 +43,25 @@ output "view" {
4243

4344
### Required
4445

45-
- `name` (String)
46+
- `name` (String) Name of the load balancer listener.
4647

4748
### Optional
4849

49-
- `connection_limit` (Number)
50-
- `loadbalancer_id` (String)
51-
- `project_id` (Number)
52-
- `project_name` (String)
53-
- `region_id` (Number)
54-
- `region_name` (String)
55-
- `timeout_client_data` (Number)
56-
- `timeout_member_connect` (Number)
57-
- `timeout_member_data` (Number)
50+
- `connection_limit` (Number) Number of simultaneous connections for this listener, between 1 and 1,000,000.
51+
- `loadbalancer_id` (String) ID of the load balancer to which listener was attached.
52+
- `project_id` (Number) ID of the project in which load balancer listener was created.
53+
- `project_name` (String) Name of the project in which load balancer listener was created.
54+
- `region_id` (Number) ID of the region in which load balancer listener was created.
55+
- `region_name` (String) Name of the region in which load balancer listener was created.
56+
- `timeout_client_data` (Number) Frontend client inactivity timeout in milliseconds.
57+
- `timeout_member_connect` (Number) Backend member connection timeout in milliseconds.
58+
- `timeout_member_data` (Number) Backend member inactivity timeout in milliseconds.
5859

5960
### Read-Only
6061

6162
- `id` (String) The ID of this resource.
62-
- `operating_status` (String)
63-
- `pool_count` (Number)
64-
- `protocol` (String) Available values is 'HTTP', 'HTTPS', 'TCP', 'UDP'
65-
- `protocol_port` (Number)
66-
- `provisioning_status` (String)
63+
- `operating_status` (String) Operating status of this listener.
64+
- `pool_count` (Number) Number of pools in this listener.
65+
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS', 'PROMETHEUS'
66+
- `protocol_port` (Number) Port number to listen, between 1 and 65535.
67+
- `provisioning_status` (String) Provisioning status of this listener.

docs/data-sources/lbpool.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ provider gcore {
1717
permanent_api_token = "251$d3361.............1b35f26d8"
1818
}
1919
20-
data "gcore_project" "pr" {
21-
name = "test"
20+
data "gcore_project" "project" {
21+
name = "Default"
2222
}
2323
24-
data "gcore_region" "rg" {
25-
name = "ED-10 Preprod"
24+
data "gcore_region" "region" {
25+
name = "Luxembourg-2"
2626
}
2727
2828
data "gcore_lbpool" "pool" {
29+
region_id = data.gcore_region.region.id
30+
project_id = data.gcore_project.project.id
31+
2932
name = "test-pool"
30-
region_id = data.gcore_region.rg.id
31-
project_id = data.gcore_project.pr.id
3233
}
3334
3435
output "view" {
@@ -41,24 +42,24 @@ output "view" {
4142

4243
### Required
4344

44-
- `name` (String)
45+
- `name` (String) Name of the load balancer pool.
4546

4647
### Optional
4748

48-
- `listener_id` (String)
49-
- `loadbalancer_id` (String)
50-
- `project_id` (Number)
51-
- `project_name` (String)
52-
- `region_id` (Number)
53-
- `region_name` (String)
49+
- `listener_id` (String) ID of the load balancer listener to which pool was attached.
50+
- `loadbalancer_id` (String) ID of the load balancer to which pool was attached.
51+
- `project_id` (Number) ID of the project in which load balancer pool was created.
52+
- `project_name` (String) Name of the project in which load balancer pool was created.
53+
- `region_id` (Number) ID of the region in which load balancer pool was created.
54+
- `region_name` (String) Name of the region in which load balancer pool was created.
5455

5556
### Read-Only
5657

57-
- `health_monitor` (List of Object) (see [below for nested schema](#nestedatt--health_monitor))
58+
- `health_monitor` (List of Object) Health Monitor settings for defining health state of members inside this pool. (see [below for nested schema](#nestedatt--health_monitor))
5859
- `id` (String) The ID of this resource.
5960
- `lb_algorithm` (String) Available values is 'ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP', 'SOURCE_IP_PORT'
60-
- `protocol` (String) Available values is 'HTTP' (currently work, other do not work on ed-8), 'HTTPS', 'TCP', 'UDP'
61-
- `session_persistence` (List of Object) (see [below for nested schema](#nestedatt--session_persistence))
61+
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'PROXY'
62+
- `session_persistence` (List of Object) Pool session persistence tells the load balancer to attempt to send future requests from a client to the same backend member as the initial request. (see [below for nested schema](#nestedatt--session_persistence))
6263

6364
<a id="nestedatt--health_monitor"></a>
6465
### Nested Schema for `health_monitor`

docs/data-sources/loadbalancer.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ provider gcore {
1717
permanent_api_token = "251$d3361.............1b35f26d8"
1818
}
1919
20-
data "gcore_project" "pr" {
21-
name = "test"
20+
data "gcore_project" "project" {
21+
name = "Default"
2222
}
2323
24-
data "gcore_region" "rg" {
25-
name = "ED-10 Preprod"
24+
data "gcore_region" "region" {
25+
name = "Luxembourg-2"
2626
}
2727
2828
data "gcore_loadbalancer" "lb" {
29-
name = "test-lb"
30-
region_id = data.gcore_region.rg.id
31-
project_id = data.gcore_project.pr.id
29+
region_id = data.gcore_region.region.id
30+
project_id = data.gcore_project.project.id
31+
32+
name = "test-lb"
3233
}
3334
3435
output "view" {

docs/data-sources/loadbalancerv2.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,53 @@ provider gcore {
1717
permanent_api_token = "251$d3361.............1b35f26d8"
1818
}
1919
20-
data "gcore_project" "pr" {
21-
name = "test"
20+
data "gcore_project" "project" {
21+
name = "Default"
2222
}
2323
24-
data "gcore_region" "rg" {
25-
name = "ED-10 Preprod"
24+
data "gcore_region" "region" {
25+
name = "Luxembourg-2"
2626
}
2727
2828
data "gcore_loadbalancerv2" "lb" {
29+
region_id = data.gcore_region.region.id
30+
project_id = data.gcore_project.project.id
31+
2932
name = "test-lb"
30-
region_id = data.gcore_region.rg.id
31-
project_id = data.gcore_project.pr.id
3233
}
3334
3435
output "view" {
3536
value = data.gcore_loadbalancerv2.lb
3637
}
38+
39+
output "lb_ip" {
40+
value = data.gcore_loadbalancerv2.lb.vip_address
41+
}
3742
```
3843

3944
<!-- schema generated by tfplugindocs -->
4045
## Schema
4146

4247
### Required
4348

44-
- `name` (String)
49+
- `name` (String) Name of the load balancer.
4550

4651
### Optional
4752

48-
- `metadata_k` (String)
49-
- `metadata_kv` (Map of String)
50-
- `project_id` (Number)
51-
- `project_name` (String)
52-
- `region_id` (Number)
53-
- `region_name` (String)
54-
- `vip_ip_family` (String)
53+
- `metadata_k` (String) Metadata string of the load balancer.
54+
- `metadata_kv` (Map of String) Metadata map of the load balancer.
55+
- `project_id` (Number) ID of the project in which load balancer was created.
56+
- `project_name` (String) Name of the project in which load balancer was created.
57+
- `region_id` (Number) ID of the region in which load balancer was created.
58+
- `region_name` (String) Name of the region in which load balancer was created.
59+
- `vip_ip_family` (String) Available values are 'ipv4', 'ipv6', 'dual'
5560

5661
### Read-Only
5762

5863
- `id` (String) The ID of this resource.
59-
- `metadata_read_only` (List of Object) (see [below for nested schema](#nestedatt--metadata_read_only))
60-
- `vip_address` (String)
61-
- `vip_port_id` (String)
64+
- `metadata_read_only` (List of Object) List of metadata items. (see [below for nested schema](#nestedatt--metadata_read_only))
65+
- `vip_address` (String) Load balancer IP address.
66+
- `vip_port_id` (String) Load balancer Port ID.
6267
- `vrrp_ips` (List of Object) (see [below for nested schema](#nestedatt--vrrp_ips))
6368

6469
<a id="nestedatt--metadata_read_only"></a>

docs/resources/floatingip.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ resource "gcore_floatingip" "floating_ip" {
3131
### Optional
3232

3333
- `fixed_ip_address` (String)
34-
- `last_updated` (String)
3534
- `metadata_map` (Map of String)
3635
- `port_id` (String)
3736
- `project_id` (Number)
@@ -44,6 +43,7 @@ resource "gcore_floatingip" "floating_ip" {
4443
- `created_at` (String)
4544
- `floating_ip_address` (String)
4645
- `id` (String) The ID of this resource.
46+
- `last_updated` (String)
4747
- `metadata_read_only` (List of Object) (see [below for nested schema](#nestedatt--metadata_read_only))
4848
- `router_id` (String)
4949
- `status` (String)

docs/resources/lblistener.md

Lines changed: 67 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
32
page_title: "gcore_lblistener Resource - terraform-provider-gcore"
43
subcategory: ""
54
description: |-
@@ -12,25 +11,60 @@ Represent load balancer listener. Can not be created without load balancer. A li
1211

1312
## Example Usage
1413

14+
### Prerequisite
15+
1516
```terraform
1617
provider gcore {
1718
permanent_api_token = "251$d3361.............1b35f26d8"
1819
}
1920
21+
data "gcore_project" "project" {
22+
name = "Default"
23+
}
24+
25+
data "gcore_region" "region" {
26+
name = "Luxembourg-2"
27+
}
28+
```
29+
30+
```terraform
2031
resource "gcore_loadbalancerv2" "lb" {
21-
project_id = 1
22-
region_id = 1
23-
name = "test"
32+
project_id = data.gcore_project.project.id
33+
region_id = data.gcore_region.region.id
34+
35+
name = "My first load balancer with listeners"
2436
flavor = "lb1-1-2"
2537
}
38+
```
39+
40+
### TCP
41+
42+
```terraform
43+
resource "gcore_lblistener" "tcp_80" {
44+
project_id = data.gcore_project.project.id
45+
region_id = data.gcore_region.region.id
46+
47+
loadbalancer_id = gcore_loadbalancerv2.lb.id
48+
49+
name = "tcp-80"
50+
protocol = "TCP"
51+
protocol_port = 80
52+
}
53+
```
54+
55+
### Prometheus metrics (from private network)
56+
57+
```terraform
58+
resource "gcore_lblistener" "prometheus_80" {
59+
project_id = data.gcore_project.project.id
60+
region_id = data.gcore_region.region.id
2661
27-
resource "gcore_lblistener" "listener" {
28-
project_id = 1
29-
region_id = 1
30-
name = "test"
31-
protocol = "TCP"
32-
protocol_port = 36621
3362
loadbalancer_id = gcore_loadbalancerv2.lb.id
63+
64+
name = "prometheus-80"
65+
protocol = "PROMETHEUS"
66+
protocol_port = 8080
67+
allowed_cidrs = ["10.0.0.0/8"] # example of how to allow access only from private network
3468
}
3569
```
3670

@@ -39,33 +73,33 @@ resource "gcore_lblistener" "listener" {
3973

4074
### Required
4175

42-
- `loadbalancer_id` (String)
43-
- `name` (String)
76+
- `loadbalancer_id` (String) ID of the target load balancer to attach newly created listener.
77+
- `name` (String) Listener name.
4478
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'TERMINATED_HTTPS', 'PROMETHEUS'
45-
- `protocol_port` (Number)
79+
- `protocol_port` (Number) Port number to listen, between 1 and 65535.
4680

4781
### Optional
4882

49-
- `connection_limit` (Number)
50-
- `insert_x_forwarded` (Boolean) Insert *-forwarded headers
51-
- `last_updated` (String)
52-
- `project_id` (Number)
53-
- `project_name` (String)
54-
- `region_id` (Number)
55-
- `region_name` (String)
56-
- `secret_id` (String)
57-
- `sni_secret_id` (List of String)
58-
- `timeout_client_data` (Number)
59-
- `timeout_member_connect` (Number)
60-
- `timeout_member_data` (Number)
83+
- `connection_limit` (Number) Number of simultaneous connections for this listener, between 1 and 1,000,000.
84+
- `insert_x_forwarded` (Boolean) Insert X-Forwarded headers for 'HTTP', 'HTTPS', 'TERMINATED_HTTPS' protocols.
85+
- `project_id` (Number) ID of the desired project to create load balancer listener in. Alternative for `project_name`. One of them should be specified.
86+
- `project_name` (String) Name of the desired project to create load balancer listener in. Alternative for `project_id`. One of them should be specified.
87+
- `region_id` (Number) ID of the desired region to create load balancer listener in. Alternative for `region_name`. One of them should be specified.
88+
- `region_name` (String) Name of the desired region to create load balancer listener in. Alternative for `region_id`. One of them should be specified.
89+
- `secret_id` (String) Secret ID to use with 'TERMINATED_HTTPS' protocol.
90+
- `sni_secret_id` (List of String) List of additional Secret IDs to use with 'TERMINATED_HTTPS' protocol.
91+
- `timeout_client_data` (Number) Frontend client inactivity timeout in milliseconds.
92+
- `timeout_member_connect` (Number) Backend member connection timeout in milliseconds.
93+
- `timeout_member_data` (Number) Backend member inactivity timeout in milliseconds.
6194
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
6295

6396
### Read-Only
6497

6598
- `id` (String) The ID of this resource.
66-
- `operating_status` (String)
67-
- `pool_count` (Number)
68-
- `provisioning_status` (String)
99+
- `last_updated` (String) Datetime when load balancer was updated at the last time.
100+
- `operating_status` (String) Operating status of this listener.
101+
- `pool_count` (Number) Number of pools in this listener.
102+
- `provisioning_status` (String) Provisioning status of this listener.
69103

70104
<a id="nestedblock--timeouts"></a>
71105
### Nested Schema for `timeouts`
@@ -75,6 +109,10 @@ Optional:
75109
- `create` (String)
76110
- `delete` (String)
77111

112+
113+
114+
115+
78116
## Import
79117

80118
Import is supported using the following syntax:
@@ -83,3 +121,4 @@ Import is supported using the following syntax:
83121
# import using <project_id>:<region_id>:<lblistener_id>:<loadbalancer_id> format
84122
terraform import gcore_lblistener.lblistener1 1:6:a775dd94-4e9c-4da7-9f0e-ffc9ae34446b:447d2959-8ae0-4ca0-8d47-9f050a3637d7
85123
```
124+

0 commit comments

Comments
 (0)