nerdexam
HashiCorp

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.

Read, generate, and modify configuration

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)
  • A
    89% (32)
  • B
    11% (4)

Why each option

The depends_on meta-argument allows explicit declaration of dependencies between resources when Terraform's implicit dependency analysis is insufficient.

Adepends_onCorrect

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.

Bdepends_off

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

#Terraform dependencies#resource meta-parameter#depends_on#resource ordering

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice