nerdexam
HashiCorpHashiCorp

TERRAFORM-ASSOCIATE-004 · Question #157

TERRAFORM-ASSOCIATE-004 Question #157: Real Exam Question with Answer & Explanation

The correct answer is D: You want to force Terraform to destroy and recreate a resource on the next apply. The -replace flag is used with the terraform apply command when there is a need to explicitly force Terraform to destroy and then recreate a specific resource during the next apply. This can be necessary in situations where a simple update is insufficient or when a resource must

Submitted by yaw92· Apr 18, 2026Use Terraform CLI

Question

Why would you use the -replace flag for terraform apply?

Options

  • AYou want Terraform to ignore a resource on the next apply
  • BYou want Terraform to destroy all the infrastructure in your workspace
  • CYou want to force Terraform to destroy a resource on the next apply
  • DYou want to force Terraform to destroy and recreate a resource on the next apply

Explanation

The -replace flag is used with the terraform apply command when there is a need to explicitly force Terraform to destroy and then recreate a specific resource during the next apply. This can be necessary in situations where a simple update is insufficient or when a resource must be re- provisioned to pick up certain changes.

Topics

#Terraform CLI#terraform apply#Resource Lifecycle#-replace flag

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 PracticeBrowse All TERRAFORM-ASSOCIATE-004 Questions