I’ve just signed up for terraform cloud and it looks great!
Got a workspace running (0.12.3) but I seem to be running into some difference when planning on TFC and locally.
On TFC, it seems like TF is not looking at the right place for the state and when it plans, it thinks its creating a brand new resource.
My main.tf looks something like:
provider "google-beta" {
project = "${var.project_id}"
}
provider "google" {
project = "${var.project_id}"
}
terraform {
backend "gcs" {
bucket = "x-terraform-admin"
prefix = "terraform/state/prod/gke"
}
}
data "terraform_remote_state" "prod-vpc" {
backend = "gcs"
config = {
bucket = "x-terraform-admin"
prefix = "terraform/state/prod/vpc"
}
}
My variables are in a file global.auto.tfvars
and I’ve added the following envvars:
GOOGLE_CREDENTIALS
GOOGLE_PROJECT
When I run terraform plan
locally, I get the expected
Plan: 0 to add, 3 to change, 0 to destroy.
But on TFC when it plans I get
Plan: 6 to add, 0 to change, 0 to destroy.
Has anyone run into this issue before?
Both environments appear to be identical.