github.com/andresvia/terraform@v0.6.15-0.20160412045437-d51c75946785/website/source/docs/providers/google/r/compute_backend_service.html.markdown (about)

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