nerdexam
HashiCorp

TA-002-P · Question #24

Why would you use the terraform taint command?

The correct answer is B. When you want to force Terraform to destroy and recreate a resource on the next apply. The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

Why would you use the terraform taint command?

Options

  • AWhen you want to force Terraform to destroy a resource on the next apply
  • BWhen you want to force Terraform to destroy and recreate a resource on the next apply
  • CWhen you want Terraform to ignore a resource on the next apply
  • DWhen you want Terraform to destroy all the infrastructure in your workspace

How the community answered

(45 responses)
  • A
    2% (1)
  • B
    91% (41)
  • C
    4% (2)
  • D
    2% (1)

Explanation

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

Topics

#Terraform CLI#terraform taint#Resource Lifecycle#Force Recreation

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice