1.
- Snapshot of infrastructure
- In file the default file
terraform.tfstate
- Can be stored in Terraform Cloud
- Inspection and Modification
- Shouldnt be modified
- state remove, forget?
- Format:
- can use with
terraform output -json
- can use with
terraform show -json
2. Purpose:
- To map real world resources
- To guarantee one-to-one mapping
- To track of metadata:
- For
terraform plan
to work faster
- For sharing
- State locking?
- Workspace:
5. Import existing resources:
6. State Locking:
- If supported by backend, Terraform will lock states for all operations that could write state
- happens automatically on all operations that could write state
- terraform force-unlock