From the course: Learning Terraform

Unlock the full course today

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

Terraform states

Terraform states

- [Instructor] When we ran Terraform, it figured out what it needed to provision based on our code. When we ran it a second time, it knew that the infrastructure had changed. So how did it keep track of what was going on in our infrastructure? In simple English, you might say that Terraform is aware of the state of our AWS infrastructure. That's also the word that Terraform uses. It keeps what's called a state file to track that. We can see that in the cloud UI by clicking on states. And click into our state here. The state file is literally just a JSON-formatted text file. For the command line tool, you can find it in your local directory. Terraform Cloud gives some more user-friendly UI for looking at it. The data file isn't particularly meant to be human-readable, but if you read carefully, you can find some useful information. So, for example, there's some details about the provider that's configured. This is the AWS provider. We can see here there's our AMI that we used for our…

Contents