...

/

The Terraform State File

The Terraform State File

Understand how Terraform state files work.

A .tfstate file was created when we ran terraform init in the previous lesson. Here, we’ll examine that file and see what happens if we lose it. The more we use Terraform, the more important it is to understand Terraform state management, especially if we work in teams.

A look at the state file

To get a state file, we create a new directory named ltthw_state and a hello_state.tf file within it. Then we execute terraform init and ...