From the course: Advanced Terraform

Unlock the full course today

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

Deploying backend resources

Deploying backend resources - Terraform Tutorial

From the course: Advanced Terraform

Deploying backend resources

- In this exercise, I'll demonstrate how to deploy the resources required by the Terraform GCS backend. When the plan and apply Terraform commands are executed. the Terraform CLI evaluates the backend configuration before it generates a plan, or deploys resources. This means that the backend resource, the GCS bucket, cannot be deployed with a configuration that uses remote state. The bucket must be set up before a remote state configuration can be deployed. You could create the bucket manually through the GCP console, or the GCloud CLI, but why not use Terraform? We absolutely can and should use Terraform to create the bucket required by the GCS backend. Execute get checkout zero three underscore zero four to switch to the branch, and then execute CD space remote state. Then, open the remote state folder here and double click on main dot tf. Here we have a separate configuration just for setting up the…

Contents