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.
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.
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
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.
camps
Highly Voted 1 year, 7 months agoprincajen
Most Recent 1 year, 9 months agoInformationOverload
1 year, 11 months agoInformationOverload
1 year, 11 months agodepal_dhir
2 years, 2 months agokeiffo2
2 years, 2 months ago