Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 65


When running the command terraform taint against a managed resource you want to force recreation upon, Terraform will immediately destroy and recreate the resource.

Show Answer
Correct Answer: B

The terraform taint command marks a resource as tainted in the Terraform state, indicating that it should be destroyed and recreated in the next apply operation. However, it does not immediately destroy and recreate the resource. This operation will be carried out during the next terraform apply run.

Discussion

10 comments
Sign in to comment
HereToReAssureMyselfOption: B
Jul 1, 2022

its not immediately The terraform taint command informs Terraform that a particular object has become degraded or damaged. Terraform represents this by marking the object as "tainted" in the Terraform state, and Terraform will propose to replace it in the next plan you create.

EltoothOption: B
Jun 28, 2022

B is correct answer. False. "The terraform taint command informs Terraform that a particular object has become degraded or damaged. Terraform represents this by marking the object as "tainted" in the Terraform state, and Terraform will propose to replace it in the next plan you create." FYI - This command is deprecated. For Terraform v0.15.2 and later, we recommend using the -replace option with terraform apply instead. For Terraform v0.15.2 and later, we recommend using the -replace option with terraform apply to force Terraform to replace an object even though there are no configuration changes that would require it. https://www.terraform.io/cli/commands/taint

Ahmad_Terraform
Jul 14, 2022

next apply.

ilmi70Option: B
Feb 21, 2024

B. False The terraform taint command only marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply. However, it does not immediately destroy and recreate the resource. The actual destruction and recreation happen when you run terraform apply.

fifi1907Option: B
Jun 2, 2022

Not A? The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.

bp339
Jun 4, 2022

Terraform will immediately destroy and recreate the resource.. tf doesn't immediately destroy it.. it will just mark it as tainted and in the next plan/apply it will recreate..so answer is B

campsOption: B
Mar 31, 2023

B. False. When running the command terraform taint against a managed resource in Terraform, you are marking the resource as tainted, which means that it will be recreated during the next terraform apply run. Tainting a resource does not immediately destroy and recreate the resource, but it causes Terraform to consider the resource as out-of-date and recreate it when the configuration is next applied.

debabrata6983Option: B
Aug 26, 2023

It doesn't apply immediately. It will replace the managed resource, which is marked as tainted in the state file, during the next execution cycle (aka terraform apply)

Molly1994Option: B
Jun 5, 2024

false. taint is marking status, terraform apply make it destroy and recreate

oab720Option: B
Jan 10, 2023

Can only be changed after ‘Terraform apply’

BennaniHaythemOption: A
Apr 17, 2023

True : When you use the terraform taint command, it marks a resource as "tainted", indicating that it needs to be recreated on the next terraform apply run. Once a resource is marked as tainted, Terraform will destroy and recreate it as part of the next apply operation. This behavior is intended to ensure that the resource is recreated from scratch and that any changes to its configuration are applied properly. Therefore, the statement "When running the command terraform taint against a managed resource you want to force recreation upon, Terraform will immediately destroy and recreate the resource" is true.