github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 session_affinity = "CLIENT_IP" 24 25 backend { 26 group = "${google_compute_instance_group_manager.foo.instance_group}" 27 } 28 29 health_checks = ["${google_compute_health_check.default.self_link}"] 30 } 31 32 resource "google_compute_instance_group_manager" "foo" { 33 name = "terraform-test" 34 instance_template = "${google_compute_instance_template.foobar.self_link}" 35 base_instance_name = "foobar" 36 zone = "us-central1-f" 37 target_size = 1 38 } 39 40 resource "google_compute_instance_template" "foobar" { 41 name = "terraform-test" 42 machine_type = "n1-standard-1" 43 44 network_interface { 45 network = "default" 46 } 47 48 disk { 49 source_image = "debian-cloud/debian-8" 50 auto_delete = true 51 boot = true 52 } 53 } 54 55 resource "google_compute_health_check" "default" { 56 name = "test" 57 check_interval_sec = 1 58 timeout_sec = 1 59 60 tcp_health_check { 61 port = "80" 62 } 63 } 64 ``` 65 66 ## Argument Reference 67 68 The following arguments are supported: 69 70 * `name` - (Required) The name of the backend service. 71 72 * `health_checks` - (Required) Specifies a list of health check objects 73 for checking the health of the backend service. 74 75 - - - 76 77 * `backend` - (Optional) The list of backends that serve this BackendService. 78 See *Backend* below. 79 80 * `description` - (Optional) The textual description for the backend service. 81 82 * `project` - (Optional) The project in which the resource belongs. If it 83 is not provided, the provider project is used. 84 85 * `protocol` - (Optional) The protocol for incoming requests. Defaults to 86 `HTTP`. 87 88 * `session_affinity` - (Optional) How to distribute load. Options are `NONE` (no 89 affinity), `CLIENT_IP`, `CLIENT_IP_PROTO`, or `CLIENT_IP_PORT_PROTO`. 90 Defaults to `NONE`. 91 92 * `region` - (Optional) The Region in which the created address should reside. 93 If it is not provided, the provider region is used. 94 95 * `timeout_sec` - (Optional) The number of secs to wait for a backend to respond 96 to a request before considering the request failed. Defaults to `30`. 97 98 99 **Backend** supports the following attributes: 100 101 * `group` - (Required) The name or URI of a Compute Engine instance group 102 (`google_compute_instance_group_manager.xyz.instance_group`) that can 103 receive traffic. 104 105 * `balancing_mode` - (Optional) Defines the strategy for balancing load. 106 Defaults to `UTILIZATION` 107 108 * `capacity_scaler` - (Optional) A float in the range [0, 1.0] that scales the 109 maximum parameters for the group (e.g., max rate). A value of 0.0 will cause 110 no requests to be sent to the group (i.e., it adds the group in a drained 111 state). The default is 1.0. 112 113 * `description` - (Optional) Textual description for the backend. 114 115 * `max_rate` - (Optional) Maximum requests per second (RPS) that the group can 116 handle. 117 118 * `max_rate_per_instance` - (Optional) The maximum per-instance requests per 119 second (RPS). 120 121 * `max_utilization` - (Optional) The target CPU utilization for the group as a 122 float in the range [0.0, 1.0]. This flag can only be provided when the 123 balancing mode is `UTILIZATION`. Defaults to `0.8`. 124 125 ## Attributes Reference 126 127 In addition to the arguments listed above, the following computed attributes are 128 exported: 129 130 * `fingerprint` - The fingerprint of the backend service. 131 132 * `self_link` - The URI of the created resource.