1. Where should terraform.tfstate live in a team?
- Email attachment
- Remote backend (e.g. S3)
- Public website
- Only on one laptop forever
Source: doonops-curriculum/variables-state--state-basics.md
Doonops lesson
Understand state file — Terraform's memory of what it created.
State = notebook where Terraform writes "I created server i-abc123". Without it, Terraform forgets and tries duplicate.
terraform.tfstate JSON maps address to real IDs; state mv/rm; remote backend S3; locking DynamoDB.
Sticker on each box in warehouse — Terraform scans stickers next time instead of buying new boxes.
Layman words first, then technical detail — read slowly
Cloud has real IDs (i-0abc...). Your .tf files only have logical names (aws_instance.app). State connects them.
main.tf says: aws_instance.app state says: aws_instance.app = i-0abc123 in ap-south-1 AWS has: real running server i-0abc123
terraform state list terraform show terraform state show aws_instance.app
Modern HCL — names are examples, not from any third-party course
# terraform state list # terraform show
Terraform runs on your computer — copy this HCL into a folder, then follow the local lab steps below.
Full implementation folder — copy all files, then run terraform commands
Copy every file below into one folder — same as a real repo module. Then run the local lab steps.
Suggested folder: Suggested path: ~/doonops-terraform/07-state/
versions.tfSee file purpose in the code belowterraform {
required_version = ">= 1.9.0"
}
2–3 quick questions before the next module
Quick check — did this module stick?
1. Where should terraform.tfstate live in a team?
2. Outputs are used to…