From the course: Advanced Terraform

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Deploying a remote state configuration

Deploying a remote state configuration - Terraform Tutorial

From the course: Advanced Terraform

Deploying a remote state configuration

- [Instructor] Previously we set up the resources we need to restore our state remotely instead of locally. Now it's time to see a remote state deployment in action. The process is very much the same as we've seen before. We'll initialize with Terraform init then plan and apply as usual. There are a couple differences. There's a small addition to the configuration and we'll run Terraform init a little differently. Execute, git checkout 03_05 to see the code and then open backend.tf. This one stanza here is all we need to tell Terraform to use the GCS backend. We could also set the bucket name here but we don't want to hard code that. Terraform evaluates the backend before it evaluates the rest of the configuration. So we can't use a variable for the bucket name. We can use a feature called partial configuration to provide the values for the backend when we run Terraform init. And here's that command now. Terraform init…

Contents