Skip to content

Commit 5a1e1bd

Browse files
rostislavboboiyabchen
authored andcommitted
Add field httpKeepAliveTimeoutSec to resources google_compute_region_target_http_proxy and google_compute_region_target_https_proxy (GoogleCloudPlatform#11634)
1 parent 0f9a3df commit 5a1e1bd

6 files changed

+151
-8
lines changed

mmv1/products/compute/RegionTargetHttpProxy.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ examples:
5050
region_url_map_name: 'url-map'
5151
region_backend_service_name: 'backend-service'
5252
region_health_check_name: 'http-health-check'
53+
- !ruby/object:Provider::Terraform::Examples
54+
name: 'region_target_http_proxy_http_keep_alive_timeout'
55+
primary_resource_id: 'default'
56+
vars:
57+
region_target_http_proxy_name: 'test-http-keep-alive-timeout-proxy'
58+
region_url_map_name: 'url-map'
59+
region_backend_service_name: 'backend-service'
60+
region_health_check_name: 'http-health-check'
5361
- !ruby/object:Provider::Terraform::Examples
5462
name: 'region_target_http_proxy_https_redirect'
5563
primary_resource_id: 'default'
@@ -104,3 +112,11 @@ properties:
104112
update_verb: :POST
105113
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb'
106114
update_url: 'projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}}/setUrlMap'
115+
- !ruby/object:Api::Type::Integer
116+
name: 'httpKeepAliveTimeoutSec'
117+
description: |
118+
Specifies how long to keep a connection open, after completing a response,
119+
while there is no matching traffic (in seconds). If an HTTP keepalive is
120+
not specified, a default value (600 seconds) will be used. For Regional
121+
HTTP(S) load balancer, the minimum allowed value is 5 seconds and the
122+
maximum allowed value is 600 seconds.

mmv1/products/compute/RegionTargetHttpsProxy.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ examples:
5858
region_url_map_name: 'url-map'
5959
region_backend_service_name: 'backend-service'
6060
region_health_check_name: 'http-health-check'
61+
- !ruby/object:Provider::Terraform::Examples
62+
name: 'region_target_https_proxy_http_keep_alive_timeout'
63+
primary_resource_id: 'default'
64+
vars:
65+
region_target_https_proxy_name: 'test-http-keep-alive-timeout-proxy'
66+
region_ssl_certificate_name: 'my-certificate'
67+
region_url_map_name: 'url-map'
68+
region_backend_service_name: 'backend-service'
69+
region_health_check_name: 'http-health-check'
6170
- !ruby/object:Provider::Terraform::Examples
6271
name: 'region_target_https_proxy_mtls'
6372
primary_resource_id: 'default'
@@ -190,6 +199,14 @@ properties:
190199
update_verb: :POST
191200
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.erb'
192201
update_url: 'projects/{{project}}/regions/{{region}}/targetHttpsProxies/{{name}}/setUrlMap'
202+
- !ruby/object:Api::Type::Integer
203+
name: 'httpKeepAliveTimeoutSec'
204+
description: |
205+
Specifies how long to keep a connection open, after completing a response,
206+
while there is no matching traffic (in seconds). If an HTTP keepalive is
207+
not specified, a default value (600 seconds) will be used. For Regioanl
208+
HTTP(S) load balancer, the minimum allowed value is 5 seconds and the
209+
maximum allowed value is 600 seconds.
193210
- !ruby/object:Api::Type::ResourceRef
194211
name: 'serverTlsPolicy'
195212
resource: 'SslPolicy'

mmv1/products/compute/TargetHttpProxy.yaml

+7-4
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ properties:
112112
description: |
113113
Specifies how long to keep a connection open, after completing a response,
114114
while there is no matching traffic (in seconds). If an HTTP keepalive is
115-
not specified, a default value (610 seconds) will be used. For Global
116-
external HTTP(S) load balancer, the minimum allowed value is 5 seconds and
117-
the maximum allowed value is 1200 seconds. For Global external HTTP(S)
118-
load balancer (classic), this option is not available publicly.
115+
not specified, a default value will be used. For Global
116+
external HTTP(S) load balancer, the default value is 610 seconds, the
117+
minimum allowed value is 5 seconds and the maximum allowed value is 1200
118+
seconds. For cross-region internal HTTP(S) load balancer, the default
119+
value is 600 seconds, the minimum allowed value is 5 seconds, and the
120+
maximum allowed value is 600 seconds. For Global external HTTP(S) load
121+
balancer (classic), this option is not available publicly.

mmv1/products/compute/TargetHttpsProxy.yaml

+7-4
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,13 @@ properties:
215215
description: |
216216
Specifies how long to keep a connection open, after completing a response,
217217
while there is no matching traffic (in seconds). If an HTTP keepalive is
218-
not specified, a default value (610 seconds) will be used. For Global
219-
external HTTP(S) load balancer, the minimum allowed value is 5 seconds and
220-
the maximum allowed value is 1200 seconds. For Global external HTTP(S)
221-
load balancer (classic), this option is not available publicly.
218+
not specified, a default value will be used. For Global
219+
external HTTP(S) load balancer, the default value is 610 seconds, the
220+
minimum allowed value is 5 seconds and the maximum allowed value is 1200
221+
seconds. For cross-region internal HTTP(S) load balancer, the default
222+
value is 600 seconds, the minimum allowed value is 5 seconds, and the
223+
maximum allowed value is 600 seconds. For Global external HTTP(S) load
224+
balancer (classic), this option is not available publicly.
222225
- !ruby/object:Api::Type::ResourceRef
223226
name: 'serverTlsPolicy'
224227
resource: 'ServerTlsPolicy'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
resource "google_compute_region_target_http_proxy" "<%= ctx[:primary_resource_id] %>" {
2+
region = "us-central1"
3+
name = "<%= ctx[:vars]['region_target_http_proxy_name'] %>"
4+
http_keep_alive_timeout_sec = 600
5+
url_map = google_compute_region_url_map.default.id
6+
}
7+
8+
resource "google_compute_region_url_map" "default" {
9+
region = "us-central1"
10+
name = "<%= ctx[:vars]['region_url_map_name'] %>"
11+
default_service = google_compute_region_backend_service.default.id
12+
13+
host_rule {
14+
hosts = ["mysite.com"]
15+
path_matcher = "allpaths"
16+
}
17+
18+
path_matcher {
19+
name = "allpaths"
20+
default_service = google_compute_region_backend_service.default.id
21+
22+
path_rule {
23+
paths = ["/*"]
24+
service = google_compute_region_backend_service.default.id
25+
}
26+
}
27+
}
28+
29+
resource "google_compute_region_backend_service" "default" {
30+
region = "us-central1"
31+
name = "<%= ctx[:vars]['region_backend_service_name'] %>"
32+
port_name = "http"
33+
protocol = "HTTP"
34+
timeout_sec = 10
35+
load_balancing_scheme = "INTERNAL_MANAGED"
36+
37+
health_checks = [google_compute_region_health_check.default.id]
38+
}
39+
40+
resource "google_compute_region_health_check" "default" {
41+
region = "us-central1"
42+
name = "<%= ctx[:vars]['region_health_check_name'] %>"
43+
44+
http_health_check {
45+
port = 80
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
resource "google_compute_region_target_https_proxy" "<%= ctx[:primary_resource_id] %>" {
2+
region = "us-central1"
3+
name = "<%= ctx[:vars]['region_target_https_proxy_name'] %>"
4+
http_keep_alive_timeout_sec = 600
5+
url_map = google_compute_region_url_map.default.id
6+
ssl_certificates = [google_compute_region_ssl_certificate.default.id]
7+
}
8+
9+
resource "google_compute_region_ssl_certificate" "default" {
10+
region = "us-central1"
11+
name = "<%= ctx[:vars]['region_ssl_certificate_name'] %>"
12+
private_key = file("path/to/private.key")
13+
certificate = file("path/to/certificate.crt")
14+
}
15+
16+
resource "google_compute_region_url_map" "default" {
17+
region = "us-central1"
18+
name = "<%= ctx[:vars]['region_url_map_name'] %>"
19+
description = "a description"
20+
21+
default_service = google_compute_region_backend_service.default.id
22+
23+
host_rule {
24+
hosts = ["mysite.com"]
25+
path_matcher = "allpaths"
26+
}
27+
28+
path_matcher {
29+
name = "allpaths"
30+
default_service = google_compute_region_backend_service.default.id
31+
32+
path_rule {
33+
paths = ["/*"]
34+
service = google_compute_region_backend_service.default.id
35+
}
36+
}
37+
}
38+
39+
resource "google_compute_region_backend_service" "default" {
40+
region = "us-central1"
41+
name = "<%= ctx[:vars]['region_backend_service_name'] %>"
42+
port_name = "http"
43+
protocol = "HTTP"
44+
timeout_sec = 10
45+
load_balancing_scheme = "INTERNAL_MANAGED"
46+
47+
health_checks = [google_compute_region_health_check.default.id]
48+
}
49+
50+
resource "google_compute_region_health_check" "default" {
51+
region = "us-central1"
52+
name = "<%= ctx[:vars]['region_health_check_name'] %>"
53+
54+
http_health_check {
55+
port = 80
56+
}
57+
}

0 commit comments

Comments
 (0)