Using Terraform Remote State with Consul Backend

Hello team Consul

I need to understand how work this code :slight_smile:

terraform {
backend “consul” {
address = “10.255.4.97:8500”
// address = “localhost:8500”
scheme = “http”
path = “tf/terraform.tfstate”
lock = true
gzip = false
datacenter = “dc1”
}
}

as i have expected the export TF_LOG=TRACE;$HOME/terraform plan && init work.

But i need to know where i can found the terraform.tfstate in consult or vault .

as regarding the doc you can retrieve the Tfstate in consul but i haven’t found yet …

tf/terraform.tfstate is a path within Consul’s KV store. If you look in the KV in the Consul UI you should be able to see it or you should also be able to find it using the consul kv cli command.

1 Like

Thks @mkeeler , thanks to you , i forget to terraform apply . Now i can see my new KV KEY . I need to learn more from consul product.
As i can see the consul doesn’t support versionning like vault or AWS S3 / GCP bucket