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 47 discussion

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

FILL BLANK -
You need to specify a dependency manually.
What resource meta-parameter can you use to make sure Terraform respects the dependency?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Show Suggested Answer Hide Answer
Suggested Answer: depends_on

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
habros
Highly Voted 2 years, 5 months ago
depends_on
upvoted 18 times
Cololand
6 months, 2 weeks ago
depends_on
upvoted 1 times
...
...
vibzr2023
Most Recent 8 months ago
depends_on In Terraform, sometimes the order in which resources are created, updated, or destroyed is important because some resources might rely on others. For example, you might not want a virtual machine to be created before the network it relies on is set up. However, there are situations where Terraform cannot infer dependencies from the configuration alone, especially when the dependency is indirect or based on operational considerations outside of Terraform's knowledge. The depends_on meta-parameter is used for this purpose. You can add depends_on to any resource block to explicitly specify that the resource depends on other resources. Terraform will ensure that the resources listed in depends_on are created before the resource that defines the dependency.
upvoted 2 times
vibzr2023
8 months ago
Suppose you have a scenario where you need to ensure a logging service is up and running before your main application starts, but there's no direct reference between the two in your Terraform configuration. You could use depends_on to define this relationship: resource "aws_cloudwatch_log_group" "example" { name = "example-log-group" # Other configuration... } resource "aws_instance" "app_server" { ami = "ami-123456" instance_type = "t2.micro" # Other configuration... # Manually specify dependency on the CloudWatch Log Group depends_on = [aws_cloudwatch_log_group.example] }
upvoted 1 times
vibzr2023
8 months ago
In the above example, even though the aws_instance.app_server doesn't directly reference the aws_cloudwatch_log_group.example, we've used depends_on to tell Terraform that the app_server should only be created after the example-log-group CloudWatch Log Group is created. This ensures that your logging infrastructure is in place before your application starts running. depends_on is particularly useful in cases where Terraform cannot automatically determine the correct order for creating, updating, or destroying resources based on the configuration alone.
upvoted 1 times
...
...
...
jutove_mi
10 months, 3 weeks ago
what is the question??
upvoted 3 times
...
Bengi
11 months ago
https://developer.hashicorp.com/terraform/language/meta-arguments/depends_on The depends_on meta-argument instructs Terraform to complete all actions on the dependency object (including Read actions) before performing actions on the object declaring the dependency. When the dependency object is an entire module, depends_on affects the order in which Terraform processes all of the resources and data sources associated with that module.
upvoted 1 times
...
KrishTeam
1 year, 2 months ago
did anyone got this question in exam
upvoted 1 times
filled
1 year, 1 month ago
sure did glad to know I at least got this one correct
upvoted 1 times
...
...
joyboy23
1 year, 4 months ago
depends_on, Not depend_on
upvoted 2 times
...
gspb
1 year, 6 months ago
depends_on
upvoted 1 times
...
Power123
1 year, 7 months ago
depends_on
upvoted 1 times
...
thor7
1 year, 7 months ago
depends_on
upvoted 1 times
...
sjoe
1 year, 8 months ago
depends_on
upvoted 1 times
...
Bilalglg93350
1 year, 8 months ago
depends_on
upvoted 1 times
...
kennynelcon
1 year, 10 months ago
depends_on
upvoted 1 times
...
G4Exams
2 years ago
explicit dependencies are set with "depends_on". No doubt.
upvoted 2 times
...
ddewit
2 years, 3 months ago
depends_on
upvoted 3 times
...
kopper2019
2 years, 3 months ago
depends_on
upvoted 3 times
...
svsilence
2 years, 4 months ago
depends_on
upvoted 4 times
...
Eltooth
2 years, 4 months ago
"depends_on" is correct answer.
upvoted 4 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 ...