Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 161 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 161
Topic #: 1
[All Terraform Associate Questions]

Which are forbidden actions when the Terraform state file is locked? (Choose three.)

  • A. terraform destroy
  • B. terraform fmt
  • C. terraform state list
  • D. terraform apply
  • E. terraform plan
  • F. terraform validate
Show Suggested Answer Hide Answer
Suggested Answer: ADE 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
camps
Highly Voted 1 year, 7 months ago
Selected Answer: ADE
A. terraform destroy D. terraform apply E. terraform plan When the Terraform state file is locked, there are certain actions that are not allowed as they can result in data corruption or loss. The actions that are forbidden when the state file is locked include: A. terraform destroy: This command destroys all resources defined in the configuration file, which could cause data loss if the state file is locked. D. terraform apply: This command applies changes to the infrastructure as defined in the configuration file, which could cause data corruption if the state file is locked. E. terraform plan: This command creates an execution plan of what changes Terraform will apply to the infrastructure, which could cause data corruption if the state file is locked. Actions such as terraform fmt, terraform state list, and terraform validate are read-only operations that do not modify the state file, and can be performed safely even when the state file is locked.
upvoted 6 times
...
princajen
Most Recent 1 year, 9 months ago
Selected Answer: ADE
A. terraform destroy, D. terraform apply, and E. terraform plan are the forbidden actions when the Terraform state file is locked. When the state file is locked, it means that another Terraform process is already running and has acquired a lock on the state file. In such a situation, it is not safe to apply changes to the infrastructure, as it may result in conflicts and errors. Therefore, the destroy, apply, and plan commands are forbidden while the state file is locked. The fmt, validate, and state list commands do not modify the state file, so they can be executed when the state file is locked.
upvoted 1 times
...
InformationOverload
1 year, 11 months ago
When the state file is locked, the following actions are forbidden: Running terraform apply or any other command that modifies the state file (e.g. terraform plan, terraform destroy, etc.) Running terraform refresh, which updates the state file to reflect the current state of the infrastructure Running terraform state push, which uploads the current state file to the remote backend Running terraform state pull, which downloads the current state file from the remote backend Running terraform state mv, which renames resources in the state file Running terraform state rm, which removes resources from the state file You have to unlock the state first with terraform state unlock
upvoted 3 times
InformationOverload
1 year, 11 months ago
ADE is correct
upvoted 1 times
...
...
depal_dhir
2 years, 2 months ago
Selected Answer: ADE
The other options are Information only
upvoted 4 times
...
keiffo2
2 years, 2 months ago
A D E is right I think
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...