Terraform & IaC (50 Qs)•Part 1: Terraform Core Architecture, HCL & Providers (1 - 15)
What is the Terraform State File (`terraform.tfstate`), and why is it essential?
senior LevelFormsCI/CD & DevOpsSystem Design
In Simple Words: Terraform must map real-world cloud resources to the resources declared in your HCL code.
The State File stores this mapping:
- Maps
aws_instance.webto AWS resource IDi-08a9f2123b. - Tracks resource metadata, dependencies, and cached attributes (private IPs, ARNs).
- Enhances performance by caching resource attributes instead of querying hundreds of cloud APIs on every run.