Skip to content

Commit acf002f

Browse files
Add field loadBalancingScheme to resources compute_target_tcp_proxy (beta) (#16681)
1 parent 2d9078f commit acf002f

5 files changed

Lines changed: 68 additions & 4 deletions

File tree

mmv1/products/compute/RegionTargetTcpProxy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ properties:
113113
type: ResourceRef
114114
description: |
115115
A reference to the BackendService resource. This field is optional when
116-
the loadBalancingScheme is specified.
116+
the loadBalancingScheme (available in beta) is specified.
117117
at_least_one_of:
118118
- 'backend_service'
119119
- 'load_balancing_scheme'

mmv1/products/compute/TargetTcpProxy.yaml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ examples:
4747
target_tcp_proxy_name: 'test-proxy'
4848
backend_service_name: 'backend-service'
4949
health_check_name: 'health-check'
50+
- name: 'target_tcp_proxy_basic_beta'
51+
min_version: beta
52+
primary_resource_id: 'default'
53+
vars:
54+
target_tcp_proxy_name: 'test-proxy'
55+
backend_service_name: 'backend-service'
56+
health_check_name: 'health-check'
57+
- name: target_tcp_proxy_backendless
58+
min_version: beta
59+
primary_resource_id: default
60+
vars:
61+
target_tcp_proxy_name: test-proxy
62+
backend_service_name: 'backend-service'
63+
health_check_name: 'health-check'
64+
tls_route_name: 'tls-route-check'
5065
parameters:
5166
properties:
5267
- name: 'creationTimestamp'
@@ -88,9 +103,12 @@ properties:
88103
- name: 'backendService'
89104
type: ResourceRef
90105
description: |
91-
A reference to the BackendService resource.
106+
A reference to the BackendService resource. This field is optional when
107+
the loadBalancingScheme (available in beta) is set to INTERNAL_MANAGED.
108+
at_least_one_of:
109+
- 'backend_service'
110+
- 'load_balancing_scheme'
92111
api_name: service
93-
required: true
94112
update_url: 'projects/{{project}}/global/targetTcpProxies/{{name}}/setBackendService'
95113
update_verb: 'POST'
96114
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl'
@@ -102,3 +120,17 @@ properties:
102120
This field only applies when the forwarding rule that references
103121
this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
104122
default_from_api: true
123+
- name: loadBalancingScheme
124+
min_version: beta
125+
type: Enum
126+
description: |
127+
Specifies the load balancer type. A target TCP proxy created for one type
128+
of load balancer cannot be used with another. For more information, refer
129+
to [Summary of types of Google Cloud load balancers](https://docs.cloud.google.com/load-balancing/docs/load-balancing-overview#summary-gclb).
130+
at_least_one_of:
131+
- 'backend_service'
132+
- 'load_balancing_scheme'
133+
enum_values:
134+
- 'EXTERNAL'
135+
- 'EXTERNAL_MANAGED'
136+
- 'INTERNAL_MANAGED'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
resource "google_compute_target_tcp_proxy" "{{$.PrimaryResourceId}}" {
2+
provider = google-beta
3+
name = "{{index $.Vars "target_tcp_proxy_name"}}"
4+
load_balancing_scheme = "INTERNAL_MANAGED"
5+
}

mmv1/templates/terraform/examples/target_tcp_proxy_basic.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resource "google_compute_target_tcp_proxy" "default" {
1+
resource "google_compute_target_tcp_proxy" "{{$.PrimaryResourceId}}" {
22
name = "{{index $.Vars "target_tcp_proxy_name"}}"
33
backend_service = google_compute_backend_service.default.id
44
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
resource "google_compute_target_tcp_proxy" "{{$.PrimaryResourceId}}" {
2+
provider = google-beta
3+
name = "{{index $.Vars "target_tcp_proxy_name"}}"
4+
load_balancing_scheme = "EXTERNAL_MANAGED"
5+
backend_service = google_compute_backend_service.default.id
6+
}
7+
8+
resource "google_compute_backend_service" "default" {
9+
provider = google-beta
10+
name = "{{index $.Vars "backend_service_name"}}"
11+
load_balancing_scheme = "EXTERNAL_MANAGED"
12+
protocol = "TCP"
13+
timeout_sec = 10
14+
15+
health_checks = [google_compute_health_check.default.id]
16+
}
17+
18+
resource "google_compute_health_check" "default" {
19+
provider = google-beta
20+
name = "{{index $.Vars "health_check_name"}}"
21+
timeout_sec = 1
22+
check_interval_sec = 1
23+
24+
tcp_health_check {
25+
port = "443"
26+
}
27+
}

0 commit comments

Comments
 (0)