github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/website/source/docs/providers/google/index.html.markdown (about)

     1  ---
     2  layout: "google"
     3  page_title: "Provider: Google Cloud"
     4  sidebar_current: "docs-google-index"
     5  description: |-
     6    The Google Cloud provider is used to interact with Google Cloud services. The provider needs to be configured with the proper credentials before it can be used.
     7  ---
     8  
     9  # Google Cloud Provider
    10  
    11  The Google Cloud provider is used to interact with
    12  [Google Cloud services](https://cloud.google.com/). The provider needs
    13  to be configured with the proper credentials before it can be used.
    14  
    15  Use the navigation to the left to read about the available resources.
    16  
    17  ## Example Usage
    18  
    19  ```
    20  # Configure the Google Cloud provider
    21  provider "google" {
    22    credentials = "${file("account.json")}"
    23    project     = "my-gce-project"
    24    region      = "us-central1"
    25  }
    26  
    27  # Create a new instance
    28  resource "google_compute_instance" "default" {
    29    ...
    30  }
    31  ```
    32  
    33  ## Configuration Reference
    34  
    35  The following keys can be used to configure the provider.
    36  
    37  * `credentials` - (Optional) Contents of the JSON file used to describe your
    38    account credentials, downloaded from Google Cloud Console. More details on
    39    retrieving this file are below. Credentials may be blank if you are running
    40    Terraform from a GCE instance with a properly-configured [Compute Engine
    41    Service Account](https://cloud.google.com/compute/docs/authentication). This
    42    can also be specified with the `GOOGLE_CREDENTIALS` shell environment
    43    variable.
    44  
    45  * `project` - (Required) The ID of the project to apply any resources to.  This
    46    can also be specified with the `GOOGLE_PROJECT` shell environment variable.
    47  
    48  * `region` - (Required) The region to operate under. This can also be specified
    49    with the `GOOGLE_REGION` shell environment variable.
    50  
    51  The following keys are supported for backwards compatibility, and may be
    52  removed in a future version:
    53  
    54  * `account_file` - __Deprecated: please use `credentials` instead.__
    55    Path to or contents of the JSON file used to describe your
    56    account credentials, downloaded from Google Cloud Console. More details on
    57    retrieving this file are below. The `account file` can be "" if you are running
    58    terraform from a GCE instance with a properly-configured [Compute Engine
    59    Service Account](https://cloud.google.com/compute/docs/authentication). This
    60    can also be specified with the `GOOGLE_ACCOUNT_FILE` shell environment
    61    variable.
    62  
    63  
    64  ## Authentication JSON File
    65  
    66  Authenticating with Google Cloud services requires a JSON
    67  file which we call the _account file_.
    68  
    69  This file is downloaded directly from the
    70  [Google Developers Console](https://console.developers.google.com). To make
    71  the process more straightforwarded, it is documented here:
    72  
    73  1. Log into the [Google Developers Console](https://console.developers.google.com)
    74     and select a project.
    75  
    76  2. Under the "APIs & Auth" section, click "Credentials."
    77  
    78  3. Create a new OAuth client ID and select "Service account" as the type
    79     of account. Once created, and after a P12 key is downloaded, a JSON file should be downloaded. This is your _account file_.