TERRAFORM-ASSOCIATE-004 · Question #133
Which are forbidden actions when the terraform state file is locked? Choose three correct answers.
The correct answer is B. Terraform destroy C. Terraform validate F. Terraform apply. The terraform state file is locked when a Terraform operation that could write state is in progress. This prevents concurrent state operations that could corrupt the state. The forbidden actions when the state file is locked are those that could write state, such as terraform app
Question
Options
- ATerraform state list
- BTerraform destroy
- CTerraform validate
- DTerraform validate
- ETerraform for
- FTerraform apply
How the community answered
(33 responses)- A6% (2)
- B88% (29)
- D3% (1)
- E3% (1)
Explanation
The terraform state file is locked when a Terraform operation that could write state is in progress. This prevents concurrent state operations that could corrupt the state. The forbidden actions when the state file is locked are those that could write state, such as terraform apply, terraform destroy, terraform refresh, terraform taint, terraform untaint, terraform import, and terraform state *. The terraform validate command is also forbidden, because it requires an initialized working directory with the state file. The allowed actions when the state file is locked are those that only read state, such as terraform plan, terraform show, terraform output, and terraform console.
Topics
Community Discussion
No community discussion yet for this question.