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