Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for regional target TCP proxy #12715

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/6622.txt
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_compute_region_target_tcp_proxy`
```
Expand Up @@ -74,7 +74,7 @@ func testSweepComputeRegionTargetHttpProxy(region string) error {
return nil
}

resourceList, ok := res["items"]
resourceList, ok := res["regionTargetHttpProxies"]
if !ok {
log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.")
return nil
Expand Down
Expand Up @@ -74,7 +74,7 @@ func testSweepComputeRegionTargetHttpsProxy(region string) error {
return nil
}

resourceList, ok := res["items"]
resourceList, ok := res["regionTargetHttpsProxies"]
if !ok {
log.Printf("[INFO][SWEEPER_LOG] Nothing found in response.")
return nil
Expand Down
1 change: 1 addition & 0 deletions google/resource_compute_region_target_tcp_proxy_test.go
@@ -0,0 +1 @@
package google
162 changes: 162 additions & 0 deletions website/docs/r/compute_region_target_tcp_proxy.html.markdown
@@ -0,0 +1,162 @@
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Compute Engine"
page_title: "Google: google_compute_region_target_tcp_proxy"
description: |-
Represents a RegionTargetTcpProxy resource, which is used by one or more
forwarding rules to route incoming TCP requests to a regional TCP proxy load
balancer.
---

# google\_compute\_region\_target\_tcp\_proxy

Represents a RegionTargetTcpProxy resource, which is used by one or more
forwarding rules to route incoming TCP requests to a regional TCP proxy load
balancer.

~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.

To get more information about RegionTargetTcpProxy, see:

* [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/targetTcpProxies)
* How-to Guides
* [Official Documentation](https://cloud.google.com/load-balancing/docs/tcp/internal-proxy)

<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%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">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Region Target Tcp Proxy Basic


```hcl
resource "google_compute_region_target_tcp_proxy" "default" {
provider = google-beta
name = "test-proxy"
region = "europe-west4"
backend_service = google_compute_region_backend_service.default.id
}

resource "google_compute_region_backend_service" "default" {
provider = google-beta
name = "backend-service"
protocol = "TCP"
timeout_sec = 10
region = "europe-west4"

health_checks = [google_compute_region_health_check.default.id]
load_balancing_scheme = "INTERNAL_MANAGED"
}

resource "google_compute_region_health_check" "default" {
provider = google-beta
name = "health-check"
region = "europe-west4"
timeout_sec = 1
check_interval_sec = 1

tcp_health_check {
port = "80"
}
}
```

## Argument Reference

The following arguments are supported:


* `name` -
(Required)
Name of the resource. Provided by the client when the resource is
created. The name must be 1-63 characters long, and comply with
RFC1035. Specifically, the name must be 1-63 characters long and match
the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the
first character must be a lowercase letter, and all following
characters must be a dash, lowercase letter, or digit, except the last
character, which cannot be a dash.

* `backend_service` -
(Required)
A reference to the BackendService resource.


- - -


* `description` -
(Optional)
An optional description of this resource.

* `proxy_header` -
(Optional)
Specifies the type of proxy header to append before sending data to
the backend.
Default value is `NONE`.
Possible values are `NONE` and `PROXY_V1`.

* `proxy_bind` -
(Optional)
This field only applies when the forwarding rule that references
this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.

* `region` -
(Optional)
The Region in which the created target TCP proxy should reside.
If it is not provided, the provider region is used.

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.


## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

* `id` - an identifier for the resource with format `projects/{{project}}/regions/{{region}}/targetTcpProxies/{{name}}`

* `creation_timestamp` -
Creation timestamp in RFC3339 text format.

* `proxy_id` -
The unique identifier for the resource.
* `self_link` - The URI of the created resource.


## Timeouts

This resource provides the following
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:

- `create` - Default is 20 minutes.
- `delete` - Default is 20 minutes.

## Import


RegionTargetTcpProxy can be imported using any of these accepted formats:

```
$ terraform import google_compute_region_target_tcp_proxy.default projects/{{project}}/regions/{{region}}/targetTcpProxies/{{name}}
$ terraform import google_compute_region_target_tcp_proxy.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_region_target_tcp_proxy.default {{region}}/{{name}}
$ terraform import google_compute_region_target_tcp_proxy.default {{name}}
```

## User Project Overrides

This resource supports [User Project Overrides](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#user_project_override).