|
| 1 | +--- |
| 2 | +layout: "google" |
| 3 | +page_title: "Google: google_compute_backend_service" |
| 4 | +sidebar_current: "docs-google-resource-backend-service" |
| 5 | +description: |- |
| 6 | + Creates a Backend Service resource for Google Compute Engine. |
| 7 | +--- |
| 8 | + |
| 9 | +# google\_compute\_backend\_service |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +## Example Usage |
| 15 | + |
| 16 | +``` |
| 17 | +resource "google_compute_backend_service" "foobar" { |
| 18 | + name = "blablah" |
| 19 | + health_checks = ["${google_compute_http_health_check.default.self_link}"] |
| 20 | +} |
| 21 | +
|
| 22 | +resource "google_compute_http_health_check" "default" { |
| 23 | + name = "test" |
| 24 | + request_path = "/" |
| 25 | + check_interval_sec = 1 |
| 26 | + timeout_sec = 1 |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +## Argument Reference |
| 31 | + |
| 32 | +The following arguments are supported: |
| 33 | + |
| 34 | +* `name` - (Required) The name of the backend service. |
| 35 | +* `health_checks` - (Required) Specifies a list of HTTP health check objects |
| 36 | + for checking the health of the backend service. |
| 37 | +* `description` - (Optional) The textual description for the backend service. |
| 38 | +* `backends` - (Optional) The list of backends that serve this BackendService. See *Backend* below. |
| 39 | +* `port_name` - (Optional) The name of a service that has been added to |
| 40 | + an instance group in this backend. See [related docs](https://cloud.google.com/compute/docs/instance-groups/#specifying_service_endpoints) |
| 41 | + for details. Defaults to http. |
| 42 | +* `protocol` - (Optional) The protocol for incoming requests. Defaults to `HTTP`. |
| 43 | +* `timeout_sec` - (Optional) The number of secs to wait for a backend to respond |
| 44 | + to a request before considering the request failed. Defaults to `30`. |
| 45 | + |
| 46 | +**Backend** supports the following attributes: |
| 47 | + |
| 48 | +* `group` - (Required) The name or URI of a Compute Engine instance group that can receive traffic. |
| 49 | +* `balancing_mode` - (Optional) Defines the strategy for balancing load. Defaults to `UTILIZATION` |
| 50 | +* `capacity_scaler` - (Optional) A float in the range [0, 1.0] that scales the maximum parameters for the group (e.g., max rate). A value of 0.0 will cause no requests to be sent to the group (i.e., it adds the group in a drained state). The default is 1.0. |
| 51 | +* `description` - (Optional) Textual description for the backend. |
| 52 | +* `max_rate` - (Optional) Maximum requests per second (RPS) that the group can handle. |
| 53 | +* `max_rate_per_instance` - (Optional) The maximum per-instance requests per second (RPS). |
| 54 | +* `max_utilization` - (Optional) The target CPU utilization for the group as a float in the range [0.0, 1.0]. This flag can only be provided when the balancing mode is `UTILIZATION`. Defaults to `0.8`. |
| 55 | + |
| 56 | +## Attributes Reference |
| 57 | + |
| 58 | +The following attributes are exported: |
| 59 | + |
| 60 | +* `name` - The name of the resource. |
| 61 | +* `backend_service` - The IP backend_service that was allocated. |
| 62 | +* `self_link` - The URI of the created resource. |
0 commit comments