nerdexam
HashiCorp

TA-002-P · 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.

The correct answer is B. False. The 'terraform taint' command marks a resource for recreation during the next 'terraform apply', but it does not immediately destroy or recreate the resource itself.

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

Question

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

Options

  • ATrue
  • BFalse

How the community answered

(60 responses)
  • A
    10% (6)
  • B
    90% (54)

Why each option

The 'terraform taint' command marks a resource for recreation during the next 'terraform apply', but it does not immediately destroy or recreate the resource itself.

ATrue
BFalseCorrect

'terraform taint' only marks a resource in the state file as "tainted," indicating that it should be destroyed and recreated on the *next subsequent 'terraform apply'* operation. It is a preparation step and does not execute any infrastructure changes immediately.

Concept tested: Terraform taint command behavior

Source: https://developer.hashicorp.com/terraform/cli/commands/taint

Topics

#terraform taint#resource lifecycle#Terraform CLI

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice