Skip to content

Commit 44cf5c2

Browse files
committed
Add metadata files and connection metadata
1 parent ff2fe84 commit 44cf5c2

File tree

11 files changed

+884
-6
lines changed

11 files changed

+884
-6
lines changed

metadata.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ spec:
3333
subBlueprints:
3434
- name: dynamic_backends
3535
location: modules/dynamic_backends
36+
- name: lb-http-backend
37+
location: modules/lb-http-backend
38+
- name: lb-http-frontend
39+
location: modules/lb-http-frontend
3640
- name: serverless_negs
3741
location: modules/serverless_negs
3842
examples:
@@ -131,11 +135,11 @@ spec:
131135
max_rate_per_endpoint = optional(number)
132136
max_utilization = optional(number)
133137
}))
134-
iap_config = object({
138+
iap_config = optional(object({
135139
enable = bool
136140
oauth2_client_id = optional(string)
137141
oauth2_client_secret = optional(string)
138-
})
142+
}))
139143
cdn_policy = optional(object({
140144
cache_mode = optional(string)
141145
signed_url_cache_max_age_sec = optional(string)

modules/dynamic_backends/metadata.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ spec:
127127
max_rate_per_endpoint = optional(number)
128128
max_utilization = optional(number)
129129
}))
130-
iap_config = object({
130+
iap_config = optional(object({
131131
enable = bool
132132
oauth2_client_id = optional(string)
133133
oauth2_client_secret = optional(string)
134-
})
134+
}))
135135
cdn_policy = optional(object({
136136
cache_mode = optional(string)
137137
signed_url_cache_max_age_sec = optional(string)

modules/lb-http-backend/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# HTTP Load balancer backend module
2+
3+
## Inputs
4+
5+
| Name | Description | Type | Default | Required |
6+
|------|-------------|------|---------|:--------:|
7+
| affinity\_cookie\_ttl\_sec | n/a | `number` | `null` | no |
8+
| cdn\_policy | n/a | <pre>object({<br> cache_mode = optional(string)<br> signed_url_cache_max_age_sec = optional(string)<br> default_ttl = optional(number)<br> max_ttl = optional(number)<br> client_ttl = optional(number)<br> negative_caching = optional(bool)<br> serve_while_stale = optional(number)<br> bypass_cache_on_request_headers = optional(list(string))<br> negative_caching_policy = optional(object({<br> code = optional(number)<br> ttl = optional(number)<br> }))<br> cache_key_policy = optional(object({<br> include_host = optional(bool)<br> include_protocol = optional(bool)<br> include_query_string = optional(bool)<br> query_string_blacklist = optional(list(string))<br> query_string_whitelist = optional(list(string))<br> include_http_headers = optional(list(string))<br> include_named_cookies = optional(list(string))<br> }))<br> })</pre> | `{}` | no |
9+
| compression\_mode | n/a | `string` | `"DISABLED"` | no |
10+
| connection\_draining\_timeout\_sec | n/a | `number` | `null` | no |
11+
| custom\_request\_headers | n/a | `list(string)` | `[]` | no |
12+
| custom\_response\_headers | n/a | `list(string)` | `[]` | no |
13+
| description | n/a | `string` | `null` | no |
14+
| edge\_security\_policy | The resource URL for the edge security policy to associate with the backend service | `string` | `null` | no |
15+
| enable\_cdn | n/a | `bool` | `false` | no |
16+
| firewall\_networks | Names of the networks to create firewall rules in | `list(string)` | <pre>[<br> "default"<br>]</pre> | no |
17+
| firewall\_projects | Names of the projects to create firewall rules in | `list(string)` | <pre>[<br> "default"<br>]</pre> | no |
18+
| groups | n/a | <pre>list(object({<br> group = string<br> description = optional(string)<br> }))</pre> | `[]` | no |
19+
| health\_check | n/a | <pre>object({<br> host = optional(string, null)<br> request_path = optional(string, null)<br> request = optional(string, null)<br> response = optional(string, null)<br> port = optional(number, null)<br> port_name = optional(string, null)<br> proxy_header = optional(string, null)<br> port_specification = optional(string, null)<br> protocol = optional(string, null)<br> check_interval_sec = optional(number, 5)<br> timeout_sec = optional(number, 5)<br> healthy_threshold = optional(number, 2)<br> unhealthy_threshold = optional(number, 2)<br> logging = optional(bool, false)<br> })</pre> | `null` | no |
20+
| host\_path\_mappings | The list of host/path for which traffic could be sent to the backend service | `list(object({ host : string, path : string }))` | <pre>[<br> {<br> "host": "*",<br> "path": "/*"<br> }<br>]</pre> | no |
21+
| iap\_config | n/a | <pre>object({<br> enable = bool<br> oauth2_client_id = optional(string)<br> oauth2_client_secret = optional(string)<br> })</pre> | <pre>{<br> "enable": false<br>}</pre> | no |
22+
| load\_balancing\_scheme | Load balancing scheme type (EXTERNAL for classic external load balancer, EXTERNAL\_MANAGED for Envoy-based load balancer, and INTERNAL\_SELF\_MANAGED for traffic director) | `string` | `"EXTERNAL_MANAGED"` | no |
23+
| locality\_lb\_policy | n/a | `string` | `null` | no |
24+
| log\_config | n/a | <pre>object({<br> enable = bool<br> sample_rate = number<br> })</pre> | <pre>{<br> "enable": true,<br> "sample_rate": 1<br>}</pre> | no |
25+
| name | Name for the backend service | `string` | n/a | yes |
26+
| outlier\_detection | n/a | <pre>object({<br> base_ejection_time = optional(object({<br> seconds = number<br> nanos = optional(number)<br> }))<br> consecutive_errors = optional(number)<br> consecutive_gateway_failure = optional(number)<br> enforcing_consecutive_errors = optional(number)<br> enforcing_consecutive_gateway_failure = optional(number)<br> enforcing_success_rate = optional(number)<br> interval = optional(object({<br> seconds = number<br> nanos = optional(number)<br> }))<br> max_ejection_percent = optional(number)<br> success_rate_minimum_hosts = optional(number)<br> success_rate_request_volume = optional(number)<br> success_rate_stdev_factor = optional(number)<br> })</pre> | `null` | no |
27+
| port\_name | n/a | `string` | `"http"` | no |
28+
| project\_id | The project to deploy to, if not set the default provider project is used. | `string` | n/a | yes |
29+
| protocol | n/a | `string` | `"HTTP"` | no |
30+
| security\_policy | The resource URL for the security policy to associate with the backend service | `string` | `null` | no |
31+
| serverless\_neg\_backends | n/a | <pre>list(object({<br> region = string<br> type = string // cloud-run, cloud-function, and app-engine<br> service_name = string<br> service_version = optional(string)<br> }))</pre> | `[]` | no |
32+
| session\_affinity | n/a | `string` | `null` | no |
33+
| target\_service\_accounts | List of target service accounts for health check firewall rule. Exactly one of target\_tags or target\_service\_accounts should be specified. | `list(string)` | `[]` | no |
34+
| target\_tags | List of target tags for health check firewall rule. Exactly one of target\_tags or target\_service\_accounts should be specified. | `list(string)` | `[]` | no |
35+
36+
## Outputs
37+
38+
| Name | Description |
39+
|------|-------------|
40+
| backend\_service\_info | Host, path and backend service mapping |
41+
42+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/lb-http-backend/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
resource "google_compute_backend_service" "default" {
218
provider = google-beta
319

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintMetadata
17+
metadata:
18+
name: terraform-google-lb-http-lb-http-backend-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: HTTP Load balancer backend module
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-lb-http.git
26+
sourceType: git
27+
dir: /modules/lb-http-backend
28+
ui:
29+
input:
30+
variables:
31+
affinity_cookie_ttl_sec:
32+
name: affinity_cookie_ttl_sec
33+
title: Affinity Cookie Ttl Sec
34+
cdn_policy:
35+
name: cdn_policy
36+
title: Cdn Policy
37+
compression_mode:
38+
name: compression_mode
39+
title: Compression Mode
40+
connection_draining_timeout_sec:
41+
name: connection_draining_timeout_sec
42+
title: Connection Draining Timeout Sec
43+
custom_request_headers:
44+
name: custom_request_headers
45+
title: Custom Request Headers
46+
custom_response_headers:
47+
name: custom_response_headers
48+
title: Custom Response Headers
49+
description:
50+
name: description
51+
title: Description
52+
edge_security_policy:
53+
name: edge_security_policy
54+
title: Edge Security Policy
55+
enable_cdn:
56+
name: enable_cdn
57+
title: Enable Cdn
58+
firewall_networks:
59+
name: firewall_networks
60+
title: Firewall Networks
61+
firewall_projects:
62+
name: firewall_projects
63+
title: Firewall Projects
64+
groups:
65+
name: groups
66+
title: Groups
67+
health_check:
68+
name: health_check
69+
title: Health Check
70+
host_path_mappings:
71+
name: host_path_mappings
72+
title: Host Path Mappings
73+
iap_config:
74+
name: iap_config
75+
title: Iap Config
76+
load_balancing_scheme:
77+
name: load_balancing_scheme
78+
title: Load Balancing Scheme
79+
locality_lb_policy:
80+
name: locality_lb_policy
81+
title: Locality Lb Policy
82+
log_config:
83+
name: log_config
84+
title: Log Config
85+
name:
86+
name: name
87+
title: Name
88+
outlier_detection:
89+
name: outlier_detection
90+
title: Outlier Detection
91+
port_name:
92+
name: port_name
93+
title: Port Name
94+
project_id:
95+
name: project_id
96+
title: Project Id
97+
protocol:
98+
name: protocol
99+
title: Protocol
100+
security_policy:
101+
name: security_policy
102+
title: Security Policy
103+
serverless_neg_backends:
104+
name: serverless_neg_backends
105+
title: Serverless Neg Backends
106+
session_affinity:
107+
name: session_affinity
108+
title: Session Affinity
109+
target_service_accounts:
110+
name: target_service_accounts
111+
title: Target Service Accounts
112+
target_tags:
113+
name: target_tags
114+
title: Target Tags

0 commit comments

Comments
 (0)