github.com/atsaki/terraform@v0.4.3-0.20150919165407-25bba5967654/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      account_file = "${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  * `account_file` - (Required) 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. The `account file` can be "" 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_ACCOUNT_FILE` 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  ## Authentication JSON File
    52  
    53  Authenticating with Google Cloud services requires a JSON
    54  file which we call the _account file_.
    55  
    56  This file is downloaded directly from the
    57  [Google Developers Console](https://console.developers.google.com). To make
    58  the process more straightforwarded, it is documented here:
    59  
    60  1. Log into the [Google Developers Console](https://console.developers.google.com)
    61     and select a project.
    62  
    63  2. Under the "APIs & Auth" section, click "Credentials."
    64  
    65  3. Create a new OAuth client ID and select "Service account" as the type
    66     of account. Once created, and after a P12 key is downloaded, a JSON file should be downloaded. This is your _account file_.