github.com/bengesoff/terraform@v0.3.1-0.20141018223233-b25a53629922/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  ---
     6  
     7  # Google Cloud Provider
     8  
     9  The Google Cloud provider is used to interact with
    10  [Google Cloud services](https://cloud.google.com/). The provider needs
    11  to be configured with the proper credentials before it can be used.
    12  
    13  Use the navigation to the left to read about the available resources.
    14  
    15  ## Example Usage
    16  
    17  ```
    18  # Configure the Google Cloud provider
    19  provider "google" {
    20      account_file = "account.json"
    21      client_secrets_file = "client_secrets.json"
    22      project = "my-gce-project"
    23      region = "us-central1"
    24  }
    25  
    26  # Create a new instance
    27  resource "google_compute_instance" "default" {
    28      ...
    29  }
    30  ```
    31  
    32  ## Configuration Reference
    33  
    34  The following keys can be used to configure the provider.
    35  
    36  * `account_file` - (Required) Path to the JSON file used to describe
    37    your account credentials, downloaded from Google Cloud Console. More
    38    details on retrieving this file are below.
    39  
    40  * `client_secrets_file` - (Required) Path to the JSON file containing
    41    the secrets for your account, downloaded from Google Cloud Console.
    42    More details on retrieving this file are below.
    43  
    44  * `project` - (Required) The name of the project to apply any resources to.
    45  
    46  * `region` - (Required) The region to operate under.
    47  
    48  ## Authentication JSON Files
    49  
    50  Authenticating with Google Cloud services requires two separate JSON
    51  files: one which we call the _account file_ and the _client secrets file_.
    52  
    53  Both of these files are downloaded directly from the
    54  [Google Developers Console](https://console.developers.google.com). To make
    55  the process more straightforwarded, it is documented here.
    56  
    57  1. Log into the [Google Developers Console](https://console.developers.google.com)
    58     and select a project.
    59  
    60  2. Under the "APIs & Auth" section, click "Credentials."
    61  
    62  3. Create a new OAuth client ID and select "Installed application" as the
    63     type of account. Once created, click the "Download JSON" button underneath
    64     the account. The file should start with "client\_secret". This is your _client
    65     secrets file_.
    66  
    67  4. Create a new OAuth client ID and select "Service account" as the type
    68     of account. Once created, a JSON file should be downloaded. This is your
    69     _account file_.