TERRAFORM-ASSOCIATE-003 · Question #157
Why would you use the -replace flag for terraform apply?
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…
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
How the community answered
(17 responses)- B12% (2)
- C6% (1)
- D82% (14)
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
Community Discussion
No community discussion yet for this question.