HashiCorp Certified: Terraform Associate — Question 224

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

Answer options

Correct answer: C

Explanation

The correct answer is C because the -replace flag specifically instructs Terraform to destroy a resource and then recreate it during the next apply. Option A is incorrect as it does not involve recreation, option B is wrong because it implies ignoring rather than replacing, and option D is not accurate as it refers to destroying all infrastructure rather than a specific resource.