Question 1 · choose 1
A plan shows one resource with the symbol -/+ and the note "forces replacement" next to a changed argument. What will apply do to it?
- ADestroy the object and create a new one, as that argument cannot change in place
- BUpdate the object in place and keep a backup copy of the old object in the state
- CLeave the object alone and change only the value recorded in state
- DCreate a second object next to it and keep both
Show the answer and why
ADestroy the object and create a new one, as that argument cannot change in place
Correct
Some arguments cannot be updated in place; Terraform then plans to destroy and re-create the object, shown as a replace action.
BUpdate the object in place and keep a backup copy of the old object in the state
Incorrect
An in-place update is shown with ~, and Terraform keeps no backup of remote objects.
CLeave the object alone and change only the value recorded in state
Incorrect
That would be a refresh-only change, not a replace action.
DCreate a second object next to it and keep both
Incorrect
Replacement ends with one object; the old one is destroyed.
-/+ marks a replacement; ~ marks an update in place.
HashiCorp documentation