Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 227 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 227
Topic #: 1
[All Terraform Associate Questions]

How does Terraform manage most dependencies between resources?

  • A. By defining dependencies as modules and including them in a particular order
  • B. The order that resources appear in Terraform configuration indicates dependencies
  • C. Using the depends_on parameter
  • D. Terraform will automatically manage most resource dependencies
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
agg42
10 months, 1 week ago
https://developer.hashicorp.com/terraform/language/resources/behavior#resource-dependencies Most resource dependencies are handled automatically. Terraform analyses any expressions within a resource block to find references to other objects, and treats those references as implicit ordering requirements when creating, updating, or destroying resources. Since most resources with behavioral dependencies on other resources also refer to those resources' data, it's usually not necessary to manually specify dependencies between resources.
upvoted 1 times
...
BaburTurk
1 year, 2 months ago
Selected Answer: D
D. Terraform will automatically manage most resource dependencies. Option A is incorrect because Terraform does not use modules to manage dependencies. Option B is incorrect because the order that resources appear in Terraform configuration does not indicate dependencies. Option C is incorrect because the depends_on parameter is used to explicitly declare dependencies, not to automatically manage them.
upvoted 3 times
...
Rajmane
1 year, 3 months ago
Selected Answer: C
It's C depends on
upvoted 1 times
...
Ashwin1011
1 year, 4 months ago
Option D is incorrect because Terraform does not automatically manage all resource dependencies. Some resource dependencies are not visible to Terraform, and you need to explicitly specify them using the depends_on parameter. For example, the following Terraform configuration defines an EC2 instance and an IAM role. The EC2 instance depends on the IAM role, but this dependency is not visible to Terraform. You need to explicitly specify the dependency using the depends_on parameter. resource "aws_instance" "web" { depends_on = ["aws_iam_role.role"] } resource "aws_iam_role" "role" { } If you do not specify the depends_on parameter, Terraform will try to create the EC2 instance before the IAM role. This will fail because the EC2 instance needs the IAM role to be able to access AWS resources. In general, it is a good practice to explicitly specify dependencies using the depends_on parameter. This will help to ensure that your infrastructure is created and updated in the correct order.
upvoted 2 times
...
Freshtimi
1 year, 7 months ago
D is correct
upvoted 1 times
...
oskarq
1 year, 7 months ago
Selected Answer: D
Only D
upvoted 1 times
...
tbhtp
1 year, 7 months ago
Selected Answer: D
D. Terraform will automatically manage most resource dependencies. Terraform is designed to recognize and manage dependencies between resources automatically, based on the values of their attributes. When a resource references another resource's attributes, Terraform understands the dependency and will create, update, or destroy resources in the correct order to satisfy those dependencies. However, in some cases where explicit dependency management is needed, you can use the "depends_on" parameter to define additional dependencies.
upvoted 4 times
...
camps
1 year, 7 months ago
Selected Answer: D
D. Terraform will automatically manage most resource dependencies Terraform is designed to automatically manage most resource dependencies by analyzing the relationships between resources based on their input and output variables. When Terraform detects that a resource relies on another resource's output or attribute, it creates an implicit dependency and ensures that resources are created, updated, or destroyed in the correct order.
upvoted 1 times
...
Witwicky
1 year, 8 months ago
D for me
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...