TERRAFORM-ASSOCIATE-004 · 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
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
(31 responses)- A3% (1)
- B3% (1)
- C6% (2)
- D87% (27)
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.