Skip to content

Commit c06396c

Browse files
Added support for regional target TCP proxy and removed some unused fields from target regional HTTP/HTTPS proxy. (#6622) (#12715)
Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent 676a822 commit c06396c

5 files changed

+168
-2
lines changed

.changelog/6622.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_compute_region_target_tcp_proxy`
3+
```

google/resource_compute_region_target_http_proxy_sweeper_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func testSweepComputeRegionTargetHttpProxy(region string) error {
7474
return nil
7575
}
7676

77-
resourceList, ok := res["items"]
77+
resourceList, ok := res["regionTargetHttpProxies"]
7878
if !ok {
7979
log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.")
8080
return nil

google/resource_compute_region_target_https_proxy_sweeper_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func testSweepComputeRegionTargetHttpsProxy(region string) error {
7474
return nil
7575
}
7676

77-
resourceList, ok := res["items"]
77+
resourceList, ok := res["regionTargetHttpsProxies"]
7878
if !ok {
7979
log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.")
8080
return nil
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package google
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Compute Engine"
16+
page_title: "Google: google_compute_region_target_tcp_proxy"
17+
description: |-
18+
Represents a RegionTargetTcpProxy resource, which is used by one or more
19+
forwarding rules to route incoming TCP requests to a regional TCP proxy load
20+
balancer.
21+
---
22+
23+
# google\_compute\_region\_target\_tcp\_proxy
24+
25+
Represents a RegionTargetTcpProxy resource, which is used by one or more
26+
forwarding rules to route incoming TCP requests to a regional TCP proxy load
27+
balancer.
28+
29+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
30+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
31+
32+
To get more information about RegionTargetTcpProxy, see:
33+
34+
* [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/targetTcpProxies)
35+
* How-to Guides
36+
* [Official Documentation](https://cloud.google.com/load-balancing/docs/tcp/internal-proxy)
37+
38+
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
39+
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=region_target_tcp_proxy_basic&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
40+
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
41+
</a>
42+
</div>
43+
## Example Usage - Region Target Tcp Proxy Basic
44+
45+
46+
```hcl
47+
resource "google_compute_region_target_tcp_proxy" "default" {
48+
provider = google-beta
49+
name = "test-proxy"
50+
region = "europe-west4"
51+
backend_service = google_compute_region_backend_service.default.id
52+
}
53+
54+
resource "google_compute_region_backend_service" "default" {
55+
provider = google-beta
56+
name = "backend-service"
57+
protocol = "TCP"
58+
timeout_sec = 10
59+
region = "europe-west4"
60+
61+
health_checks = [google_compute_region_health_check.default.id]
62+
load_balancing_scheme = "INTERNAL_MANAGED"
63+
}
64+
65+
resource "google_compute_region_health_check" "default" {
66+
provider = google-beta
67+
name = "health-check"
68+
region = "europe-west4"
69+
timeout_sec = 1
70+
check_interval_sec = 1
71+
72+
tcp_health_check {
73+
port = "80"
74+
}
75+
}
76+
```
77+
78+
## Argument Reference
79+
80+
The following arguments are supported:
81+
82+
83+
* `name` -
84+
(Required)
85+
Name of the resource. Provided by the client when the resource is
86+
created. The name must be 1-63 characters long, and comply with
87+
RFC1035. Specifically, the name must be 1-63 characters long and match
88+
the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
89+
first character must be a lowercase letter, and all following
90+
characters must be a dash, lowercase letter, or digit, except the last
91+
character, which cannot be a dash.
92+
93+
* `backend_service` -
94+
(Required)
95+
A reference to the BackendService resource.
96+
97+
98+
- - -
99+
100+
101+
* `description` -
102+
(Optional)
103+
An optional description of this resource.
104+
105+
* `proxy_header` -
106+
(Optional)
107+
Specifies the type of proxy header to append before sending data to
108+
the backend.
109+
Default value is `NONE`.
110+
Possible values are `NONE` and `PROXY_V1`.
111+
112+
* `proxy_bind` -
113+
(Optional)
114+
This field only applies when the forwarding rule that references
115+
this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
116+
117+
* `region` -
118+
(Optional)
119+
The Region in which the created target TCP proxy should reside.
120+
If it is not provided, the provider region is used.
121+
122+
* `project` - (Optional) The ID of the project in which the resource belongs.
123+
If it is not provided, the provider project is used.
124+
125+
126+
## Attributes Reference
127+
128+
In addition to the arguments listed above, the following computed attributes are exported:
129+
130+
* `id` - an identifier for the resource with format `projects/{{project}}/regions/{{region}}/targetTcpProxies/{{name}}`
131+
132+
* `creation_timestamp` -
133+
Creation timestamp in RFC3339 text format.
134+
135+
* `proxy_id` -
136+
The unique identifier for the resource.
137+
* `self_link` - The URI of the created resource.
138+
139+
140+
## Timeouts
141+
142+
This resource provides the following
143+
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
144+
145+
- `create` - Default is 20 minutes.
146+
- `delete` - Default is 20 minutes.
147+
148+
## Import
149+
150+
151+
RegionTargetTcpProxy can be imported using any of these accepted formats:
152+
153+
```
154+
$ terraform import google_compute_region_target_tcp_proxy.default projects/{{project}}/regions/{{region}}/targetTcpProxies/{{name}}
155+
$ terraform import google_compute_region_target_tcp_proxy.default {{project}}/{{region}}/{{name}}
156+
$ terraform import google_compute_region_target_tcp_proxy.default {{region}}/{{name}}
157+
$ terraform import google_compute_region_target_tcp_proxy.default {{name}}
158+
```
159+
160+
## User Project Overrides
161+
162+
This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).

0 commit comments

Comments
 (0)