Question 280
In a Terraform deployment, an infrastructure reviewer needs to recreate a dependent object whenever a referenced managed resource attribute changes. Which option is the best technical fit?
Explanation
Correct Answer
Replace_triggered_by links replacement to other resource changes. This meets the stated requirement to recreate a dependent object whenever a referenced managed resource attribute changes.
Incorrect Answers
prevent_destroy lifecycle rule is intended to stop an accidental plan from deleting a critical configured database; prevent_destroy rejects destructive changes while its configuration remains present. That is not the specific requirement to recreate a dependent object whenever a referenced managed resource attribute changes.
create_before_destroy lifecycle rule is intended to provision a replacement before tearing down the existing service when supported by the platform; the lifecycle rule reverses default replacement ordering. That is not the specific requirement to recreate a dependent object whenever a referenced managed resource attribute changes.
depends_on meta-argument is intended to require an explicit ordering when the dependency is not represented by an attribute reference; depends_on declares additional graph edges for hidden dependencies. That is not the specific requirement to recreate a dependent object whenever a referenced managed resource attribute changes.






HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests