TA-002-P · Question #375
You need to specify a dependency manually. What resource meta-parameter can you use lo make sure Terraform respects thee dependency? Type your answer in the field provided. The text field is not case-
The correct answer is A. depends_on. The depends_on meta-argument allows explicit declaration of dependencies between resources when Terraform's implicit dependency analysis is insufficient.
Question
You need to specify a dependency manually. What resource meta-parameter can you use lo make sure Terraform respects thee dependency? Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
Options
- Adepends_on
- Bdepends_off
How the community answered
(36 responses)- A89% (32)
- B11% (4)
Why each option
The depends_on meta-argument allows explicit declaration of dependencies between resources when Terraform's implicit dependency analysis is insufficient.
The depends_on meta-argument is used to explicitly specify that a resource or module depends on another resource or module, forcing Terraform to create or update the dependency first before proceeding with the dependent resource. This is necessary when Terraform cannot infer the dependency automatically through interpolation.
depends_off is not a valid meta-parameter in Terraform for managing resource dependencies.
Concept tested: Terraform explicit resource dependencies
Source: https://developer.hashicorp.com/terraform/language/meta-arguments/depends_on
Topics
Community Discussion
No community discussion yet for this question.