From the course: Terraform: Managing Network Infrastructure
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Understanding Terraform state - Terraform Tutorial
From the course: Terraform: Managing Network Infrastructure
Understanding Terraform state
- [Instructor] When you think through all the infrastructure required to run a global application in the cloud, it might make your head spin. It is far too much to commit in your own memory. Not only that, but what about the relationships that exist between all of these resources? Lucky for us, Terraform does a swell job at handling this so we don't have to. "Once the business data has been centralized and integrated, the value of the database is greater than the sum of the preexisting parts." When you provision infrastructure with Terraform, it keeps track of all the changes you make in a JSON file. By default, this will get saved in your working directory as terraform.tfstate. This state file is very important. Every time you run Terraform, it gets used to compare desired and operational state, and then adjusts things accordingly. So where should you store Terraform state files? For most of this course, we aren't really…