Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mmv1/products/compute/RegionTargetTcpProxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ properties:
type: ResourceRef
description: |
A reference to the BackendService resource. This field is optional when
the loadBalancingScheme is specified.
the loadBalancingScheme (available in beta) is specified.
at_least_one_of:
- 'backend_service'
- 'load_balancing_scheme'
Expand Down
36 changes: 34 additions & 2 deletions mmv1/products/compute/TargetTcpProxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ examples:
target_tcp_proxy_name: 'test-proxy'
backend_service_name: 'backend-service'
health_check_name: 'health-check'
- name: 'target_tcp_proxy_basic_beta'
min_version: beta
primary_resource_id: 'default'
vars:
target_tcp_proxy_name: 'test-proxy'
backend_service_name: 'backend-service'
health_check_name: 'health-check'
- name: target_tcp_proxy_backendless
min_version: beta
primary_resource_id: default
vars:
target_tcp_proxy_name: test-proxy
backend_service_name: 'backend-service'
health_check_name: 'health-check'
tls_route_name: 'tls-route-check'
parameters:
properties:
- name: 'creationTimestamp'
Expand Down Expand Up @@ -88,9 +103,12 @@ properties:
- name: 'backendService'
type: ResourceRef
description: |
A reference to the BackendService resource.
A reference to the BackendService resource. This field is optional when
the loadBalancingScheme (available in beta) is set to INTERNAL_MANAGED.
at_least_one_of:
- 'backend_service'
- 'load_balancing_scheme'
api_name: service
required: true
update_url: 'projects/{{project}}/global/targetTcpProxies/{{name}}/setBackendService'
update_verb: 'POST'
custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl'
Expand All @@ -102,3 +120,17 @@ properties:
This field only applies when the forwarding rule that references
this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
default_from_api: true
- name: loadBalancingScheme
min_version: beta
type: Enum
description: |
Specifies the load balancer type. A target TCP proxy created for one type
of load balancer cannot be used with another. For more information, refer
to [Summary of types of Google Cloud load balancers](https://docs.cloud.google.com/load-balancing/docs/load-balancing-overview#summary-gclb).
at_least_one_of:
- 'backend_service'
- 'load_balancing_scheme'
enum_values:
- 'EXTERNAL'
- 'EXTERNAL_MANAGED'
- 'INTERNAL_MANAGED'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "google_compute_target_tcp_proxy" "{{$.PrimaryResourceId}}" {
provider = google-beta
name = "{{index $.Vars "target_tcp_proxy_name"}}"
load_balancing_scheme = "INTERNAL_MANAGED"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "google_compute_target_tcp_proxy" "default" {
resource "google_compute_target_tcp_proxy" "{{$.PrimaryResourceId}}" {
name = "{{index $.Vars "target_tcp_proxy_name"}}"
backend_service = google_compute_backend_service.default.id
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
resource "google_compute_target_tcp_proxy" "{{$.PrimaryResourceId}}" {
provider = google-beta
name = "{{index $.Vars "target_tcp_proxy_name"}}"
load_balancing_scheme = "EXTERNAL_MANAGED"
backend_service = google_compute_backend_service.default.id
}

resource "google_compute_backend_service" "default" {
provider = google-beta
name = "{{index $.Vars "backend_service_name"}}"
load_balancing_scheme = "EXTERNAL_MANAGED"
protocol = "TCP"
timeout_sec = 10

health_checks = [google_compute_health_check.default.id]
}

resource "google_compute_health_check" "default" {
provider = google-beta
name = "{{index $.Vars "health_check_name"}}"
timeout_sec = 1
check_interval_sec = 1

tcp_health_check {
port = "443"
}
}
Loading