Question 390
A Terraform associate evaluates: A deployment requires a particular policy setup completed before a managed workload starts. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: A deployment requires a particular policy setup completed before a managed workload starts. The directly relevant Terraform response is: Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first. This addresses the related failure mode: Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. Validate the result by checking: The resource graph includes the required ordering without invented dependencies between unrelated resources. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: A deployment requires a particular policy setup completed before a managed workload starts. The acceptance evidence is: The resource graph includes the required ordering without invented dependencies between unrelated resources. It verifies the corrective approach (Use depends_on only when a real ordering requirement is not represented by an attribute reference, after checking implicit dependencies first.) and controls the risk: Terraform may not infer relationships that have no data reference, but excessive explicit dependencies can make plans unnecessarily conservative. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
Use lifecycle create_before_destroy for supported replacements requiring new capacity before old removal, while checking name uniqueness and provider constraints. This belongs to Lifecycle create_before_destroy (official objective 4f). Its separate risk is that a replacement may fail if a globally unique name prevents a second object from existing simultaneously. The question instead tests Explicit depends_on for hidden dependencies; that other safeguard alone does not verify it.
The plan shows dependent resources using the produced attribute and schedules operations accordingly. This is relevant to Implicit dependency through attribute reference (official objective 4b). Its distinct failure risk is that hardcoding an anticipated ID bypasses Terraform's graph and can reference a stale or nonexistent object. The present question tests Explicit depends_on for hidden dependencies, which this measure alone does not establish.
Removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. This addresses count versus for_each stable addressing (official objective 4e). The separate hazard is that removing a middle entry from a count-indexed collection can shift addresses and provoke unintended replacements. It does not by itself satisfy the case-specific requirement for Explicit depends_on for hidden dependencies.