Terraform Remote State Configuration

We allow provision your infrastructure to one cloud and save your terraform state file in another. For instance, you want to provision your cluster to GCP, but wouldn’t use GCP file storage, because you have some valuable reason for that, and you simply fancy AWS S3.

Configuration

Configuration is very simple, all what you need is changing 3 parameters which you can find below.

# Terraform state location - one and only one, no matter how many clouds are involved
tf_state:
    provider: gcp #s3, azurerm
    location: europe-west1
    scope_env: GOOGLE_PROJECT #environment variable name to refer cloud scope (project, account, etc)
  • tf_state.provider - cloud storage provider for state file

  • tf_state.location - region for creating bucket

  • tf_state.scope_env - project name for correct bucket name

That’s it.