github.com/nbering/terraform@v0.8.5-0.20170113232247-453f670684b5/website/source/docs/providers/google/r/compute_region_backend_service.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_compute_region_backend_service" 4 sidebar_current: "docs-google-compute-region-backend-service" 5 description: |- 6 Creates a Region Backend Service resource for Google Compute Engine. 7 --- 8 9 # google\_compute\_region\_backend\_service 10 11 A Region Backend Service defines a regionally-scoped group of virtual machines that will serve traffic for load balancing. 12 13 See [backendServices](https://cloud.google.com/compute/docs/reference/latest/backendServices) documentation for more on this resource type, and [Internal Load Balancing](https://cloud.google.com/compute/docs/load-balancing/internal/) documentation for more details on usage. 14 15 ## Example Usage 16 17 ```tf 18 resource "google_compute_region_backend_service" "foobar" { 19 name = "blablah" 20 description = "Hello World 1234" 21 protocol = "TCP" 22 timeout_sec = 10 23 24 backend { 25 group = "${google_compute_instance_group_manager.foo.instance_group}" 26 } 27 28 health_checks = ["${google_compute_health_check.default.self_link}"] 29 } 30 31 resource "google_compute_instance_group_manager" "foo" { 32 name = "terraform-test" 33 instance_template = "${google_compute_instance_template.foobar.self_link}" 34 base_instance_name = "foobar" 35 zone = "us-central1-f" 36 target_size = 1 37 } 38 39 resource "google_compute_instance_template" "foobar" { 40 name = "terraform-test" 41 machine_type = "n1-standard-1" 42 43 network_interface { 44 network = "default" 45 } 46 47 disk { 48 source_image = "debian-cloud/debian-8" 49 auto_delete = true 50 boot = true 51 } 52 } 53 54 resource "google_compute_health_check" "default" { 55 name = "test" 56 check_interval_sec = 1 57 timeout_sec = 1 58 type = "TCP" 59 tcp_health_check { 60 port = "80" 61 } 62 } 63 ``` 64 65 ## Argument Reference 66 67 The following arguments are supported: 68 69 * `name` - (Required) The name of the backend service. 70 71 * `health_checks` - (Required) Specifies a list of health check objects 72 for checking the health of the backend service. 73 74 - - - 75 76 * `backend` - (Optional) The list of backends that serve this BackendService. 77 See *Backend* below. 78 79 * `description` - (Optional) The textual description for the backend service. 80 81 * `project` - (Optional) The project in which the resource belongs. If it 82 is not provided, the provider project is used. 83 84 * `protocol` - (Optional) The protocol for incoming requests. Defaults to 85 `HTTP`. 86 87 * `region` - (Optional) The Region in which the created address should reside. 88 If it is not provided, the provider region is used. 89 90 * `timeout_sec` - (Optional) The number of secs to wait for a backend to respond 91 to a request before considering the request failed. Defaults to `30`. 92 93 94 **Backend** supports the following attributes: 95 96 * `group` - (Required) The name or URI of a Compute Engine instance group 97 (`google_compute_instance_group_manager.xyz.instance_group`) that can 98 receive traffic. 99 100 * `balancing_mode` - (Optional) Defines the strategy for balancing load. 101 Defaults to `UTILIZATION` 102 103 * `capacity_scaler` - (Optional) A float in the range [0, 1.0] that scales the 104 maximum parameters for the group (e.g., max rate). A value of 0.0 will cause 105 no requests to be sent to the group (i.e., it adds the group in a drained 106 state). The default is 1.0. 107 108 * `description` - (Optional) Textual description for the backend. 109 110 * `max_rate` - (Optional) Maximum requests per second (RPS) that the group can 111 handle. 112 113 * `max_rate_per_instance` - (Optional) The maximum per-instance requests per 114 second (RPS). 115 116 * `max_utilization` - (Optional) The target CPU utilization for the group as a 117 float in the range [0.0, 1.0]. This flag can only be provided when the 118 balancing mode is `UTILIZATION`. Defaults to `0.8`. 119 120 ## Attributes Reference 121 122 In addition to the arguments listed above, the following computed attributes are 123 exported: 124 125 * `fingerprint` - The fingerprint of the backend service. 126 127 * `self_link` - The URI of the created resource.