terraform-provider-google/website/docs/r/compute_region_backend_service.html.markdown
Sam Levenick 3cbbc66b99 Generate RegionBackendService in terraform
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-05-01 22:20:15 +00:00

184 lines
6.4 KiB
Markdown

---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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.
#
# ----------------------------------------------------------------------------
layout: "google"
page_title: "Google: google_compute_region_backend_service"
sidebar_current: "docs-google-compute-region-backend-service"
description: |-
A Region Backend Service defines a regionally-scoped group of virtual
machines that will serve traffic for load balancing.
---
# google\_compute\_region\_backend\_service
A Region Backend Service defines a regionally-scoped group of virtual
machines that will serve traffic for load balancing.
Region backend services can only be used when using internal load balancing.
For external load balancing, use a global backend service instead.
To get more information about RegionBackendService, see:
* [API documentation](https://cloud.google.com/compute/docs/reference/latest/regionBackendServices)
* How-to Guides
* [Internal TCP/UDP Load Balancing](https://cloud.google.com/compute/docs/load-balancing/internal/)
<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_backend_service_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 Backend Service Basic
```hcl
resource "google_compute_region_backend_service" "default" {
name = "region-backend-service"
region = "us-central1"
health_checks = ["${google_compute_health_check.default.self_link}"]
connection_draining_timeout_sec = 10
session_affinity = "CLIENT_IP"
}
resource "google_compute_health_check" "default" {
name = "health-check"
check_interval_sec = 1
timeout_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.
* `health_checks` -
(Required)
The list of HealthChecks for checking the health of the backend service.
Currently at most one health check can be specified, and a health check
is required.
- - -
* `backend` -
(Optional)
The list of backends that serve this RegionBackendService. Structure is documented below.
* `description` -
(Optional)
An optional description of this resource.
* `protocol` -
(Optional)
The protocol this BackendService uses to communicate with backends.
The possible values are TCP and UDP, and the default is TCP.
* `session_affinity` -
(Optional)
Type of session affinity to use. The default is NONE.
Can be NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
When the protocol is UDP, this field is not used.
* `region` -
(Optional)
The Region in which the created backend service should reside.
If it is not provided, the provider region is used.
* `timeout_sec` -
(Optional)
How many seconds to wait for the backend before considering it a
failed request. Default is 30 seconds. Valid range is [1, 86400].
* `connection_draining_timeout_sec` -
(Optional)
Time for which instance will be drained (not accept new
connections, but still work to finish started).
* `load_balancing_scheme` -
(Optional)
This signifies what the ForwardingRule will be used for and can only
be INTERNAL for RegionBackendServices
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
The `backend` block supports:
* `description` -
(Optional)
An optional description of this resource.
Provide this property when you create the resource.
* `group` -
(Optional)
The fully-qualified URL of an Instance Group. This defines the list
of instances that serve traffic. Member virtual machine
instances from each instance group must live in the same zone as
the instance group itself. No two backends in a backend service
are allowed to use same Instance Group resource.
Note that you must specify an Instance Group
resource using the fully-qualified URL, rather than a
partial URL.
The instance group must be within the same region as the BackendService.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `fingerprint` -
Fingerprint of this resource. A hash of the contents stored in this
object. This field is used in optimistic locking.
* `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 4 minutes.
- `update` - Default is 4 minutes.
- `delete` - Default is 4 minutes.
## Import
RegionBackendService can be imported using any of these accepted formats:
```
$ terraform import google_compute_region_backend_service.default projects/{{project}}/regions/{{region}}/backendServices/{{name}}
$ terraform import google_compute_region_backend_service.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_region_backend_service.default {{name}}
```
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
as an argument so that Terraform uses the correct provider to import your resource.