Question 70
A reviewer has to approve a two-part design: retain references needed to reconcile previously created resources; additionally, plan how to protect, back up, and restore state deliberately. Which option pairs the correct mechanisms?
Explanation
Correct Answer
For the first criterion, state helps Terraform track relationships and objects that may no longer be present in configuration; its purpose extends beyond saving a copy of HCL source code; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately; this directly addresses the need to retain references needed to reconcile previously created resources. For the separate second criterion, an invalid or outdated state snapshot can confuse planned operations; recovery needs controlled version handling, not arbitrary deletion of an active backend; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately; this fulfills the need to plan how to protect, back up, and restore state deliberately. Together they cover the independent tasks of retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately without exchanging the responsibilities of these features.
Incorrect Answers
The second measure does meet the plan how to protect, back up, and restore state deliberately requirement, but the first is designed for another concern: State binds addresses in configuration to provider-specific remote IDs and recorded attributes; without that mapping Terraform cannot reliably correlate every declared block with an existing object; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. That first component is designed to identify which remote object Terraform currently manages for a resource block, which does not accomplish the requested task to retain references needed to reconcile previously created resources, even though the other measure satisfies plan how to protect, back up, and restore state deliberately.
The first measure meets the requirement to retain references needed to reconcile previously created resources, but its partner serves a different role: Configuration declares intended resources while state records what Terraform tracks; removing a block can plan destruction unless a supported removal mechanism changes that intent; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. That second component is designed to recognize that a state entry is not a request to keep an object forever, so the still-missing criterion is to plan how to protect, back up, and restore state deliberately, while the first criterion remains retain references needed to reconcile previously created resources.
The first measure is intended to explain why plans may propose correcting unapproved changes: When someone alters a tracked object directly, current cloud attributes can differ from state and configuration; terraform surfaces reconciliation actions during planning; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. The second measure is intended to make one authoritative state accessible to a collaborating team: Remote backends centralize state storage and may offer locking; sharing a state file via Git is not an equivalent concurrency or secret-management solution; this behavior should be assessed against the concrete need to retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately. Neither is the directly designated method for the separate goals of retain references needed to reconcile previously created resources and plan how to protect, back up, and restore state deliberately in this review.