Terraform is fundamentally operated off of these things called “state files”. State files literally are the single source of truth, as far as Terraform is concerned, in regard to your infrastructure. They’re formatted in regular JSON but carry a lot of metadata that helps Terraform plan and predict what will happen with your infrastructure.
All infrastructure orchestrators have to work off of some sort of state. Interpreting live infrastructure state is complicated and sluggish at scale so many of them resort to some sort of centrally hosted file system that indicates this state to them. CloudFormation actually does much of the same thing with CloudFormation templates in S3 Buckets, you just see less of it exposed to you.
What Terraform really enables is an organization of infrastructure that can be reused, version controlled, and browsed by anyone in the organization. Nobody goes to the S3 bucket and views the Terraform state file, rather, they view the code that generated that state file hence it’s important not to make manual modifications to infrastructure once an orchestrator has run.Read more →