FEATURES OPEN SOURCE ABOUT DOCS LOGIN REGISTER

Google Cloud Provider

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.

Use the navigation to the left to read about the available resources.

Example Usage

// Configure the Google Cloud provider
provider "google" {
  credentials = "${file("account.json")}"
  project     = "my-gce-project"
  region      = "us-central1"
}

// Create a new instance
resource "google_compute_instance" "default" {
  // ...
}

Configuration Reference

The following keys can be used to configure the provider.

The following keys are supported for backwards compatibility, and may be removed in a future version:

Authentication JSON File

Authenticating with Google Cloud services requires a JSON file which we call the account file.

This file is downloaded directly from the Google Developers Console. To make the process more straightforwarded, it is documented here:

  1. Log into the Google Developers Console and select a project.

  2. The API Manager view should be selected, click on “Credentials” on the left, then “Create credentials”, and finally “Service account key”.

  3. Select “Compute Engine default service account” in the “Service account” dropdown, and select “JSON” as the key type.

  4. Clicking “Create” will download your credentials.


See the source of this document at Terraform.io