github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/website/source/docs/state/remote/gcs.html.md (about)

     1  ---
     2  layout: "remotestate"
     3  page_title: "Remote State Backend: gcs"
     4  sidebar_current: "docs-state-remote-gcs"
     5  description: |-
     6    Terraform can store the state remotely, making it easier to version and work with in a team.
     7  ---
     8  
     9  # gcs
    10  
    11  Stores the state as a given key in a given bucket on [Google Cloud Storage](https://cloud.google.com/storage/).
    12  
    13  -> **Note:** Passing credentials directly via config options will
    14  make them included in cleartext inside the persisted state.
    15  Use of environment variables or config file is recommended.
    16  
    17  ## Example Usage
    18  
    19  ```
    20  terraform remote config \
    21  	-backend=gcs \
    22  	-backend-config="bucket=terraform-state-prod" \
    23  	-backend-config="path=network/terraform.tfstate" \
    24  	-backend-config="project=goopro"
    25  ```
    26  
    27  ## Example Referencing
    28  
    29  ```hcl
    30  # setup remote state data source
    31  data "terraform_remote_state" "foo" {
    32  	backend = "gcs"
    33  	config {
    34  		bucket = "terraform-state-prod"
    35  		path = "network/terraform.tfstate"
    36  		project = "goopro"
    37  	}
    38  }
    39  
    40  # read value from data source
    41  resource "template_file" "bar" {
    42    template = "${greeting}"
    43  
    44    vars {
    45      greeting = "${data.terraform_remote_state.foo.output.greeting}"
    46    }
    47  }
    48  ```
    49  
    50  ## Configuration variables
    51  
    52  The following configuration options are supported:
    53  
    54   * `bucket` - (Required) The name of the GCS bucket
    55   * `path` - (Required) The path where to place/look for state file inside the bucket