Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

HashiCorp Exam Terraform-Associate-003 Topic 4 Question 21 Discussion

Actual exam question for HashiCorp's Terraform-Associate-003 exam
Question #: 21
Topic #: 4
[All Terraform-Associate-003 Questions]

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

Show Suggested Answer Hide Answer
Suggested Answer: D

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.


Contribute your Thoughts:

Monte
12 days ago
I heard the -replace flag is short for 'replace your entire infrastructure with a single command'. Maybe option B is the secret hidden feature?
upvoted 0 times
...
Nettie
15 days ago
Wait, did someone say 'destroy all the infrastructure'? That's one way to clear up your Terraform workspace!
upvoted 0 times
...
Daren
17 days ago
This question is a piece of cake! D is the only option that makes sense for the -replace flag.
upvoted 0 times
...
Yasuko
18 days ago
C) Destroying a resource? Nah, that's too extreme. I think D is the way to go here.
upvoted 0 times
...
Lucia
24 days ago
It could be, but it depends on the specific requirements of the infrastructure.
upvoted 0 times
...
Hollis
26 days ago
A) What? Ignoring a resource? That's not what the -replace flag is for. Clearly, the answer is D.
upvoted 0 times
...
Derick
28 days ago
D) Seems like the right choice to me. Forcing Terraform to destroy and recreate a resource is exactly what the -replace flag is for.
upvoted 0 times
Talia
8 days ago
D) You want to force Terraform to destroy and recreate a resource on the next apply
upvoted 0 times
...
Anglea
12 days ago
A) You want Terraform to ignore a resource on the next apply
upvoted 0 times
...
...
Delisa
1 months ago
But wouldn't destroying and recreating a resource be more efficient in some cases?
upvoted 0 times
...
Lucia
1 months ago
I disagree, I believe the answer is C. -replace flag is used to force Terraform to destroy a resource.
upvoted 0 times
...
Delisa
2 months ago
I think the answer is D. You use -replace flag to destroy and recreate a resource.
upvoted 0 times
...

Save Cancel