A team stores state in S3 with locking enabled, as in this backend configuration. What does state locking protect against?
terraform {
backend "s3" {
bucket = "acme-tfstate"
key = "prod/network.tfstate"
region = "us-east-1"
use_lockfile = true
}
}- A.
Anyone reading the bucket without permissions.
- B.
Provider plugins being updated.
- C.
Variable values appearing in logs.
- D.
Two people or pipelines running operations that write state at the same time.
Show answer and explanation
Answer: D
State locking blocks concurrent operations that could write to the same state and corrupt it.
- Anyone reading the bucket without permissions.: Access control is separate from locking.
- Provider plugins being updated.: Locking doesn't control provider versions.
- Variable values appearing in logs.: That relates to sensitive values.