exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 63 discussion

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

A Terraform local value can reference other Terraform local values.

  • A. True
  • B. False
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Eltooth
Highly Voted 2 years ago
Answer is correct : True "The expressions in local values are not limited to literal constants; they can also reference other values in the module in order to transform or combine them, including variables, resource attributes, or other local values:" https://www.terraform.io/language/values/locals#declaring-a-local-value
upvoted 13 times
...
Molly1994
Most Recent 3 weeks, 1 day ago
A locals { # Ids for multiple sets of EC2 instances, merged together instance_ids = concat(aws_instance.blue.*.id, aws_instance.green.*.id) } locals { # Common tags to be assigned to all resources common_tags = { Service = local.service_name Owner = local.owner } }
upvoted 2 times
...
ilmi70
4 months, 1 week ago
locals { common_tags = { Owner = "team-name" Service = "customer-service" } extra_tags = merge(local.common_tags, { Environment = "production" }) }
upvoted 1 times
...
debabrata6983
10 months ago
Selected Answer: A
The right answer is A as local value can also reference other terraform local value(s)
upvoted 1 times
...
Ragque
10 months, 1 week ago
Selected Answer: A
A is the correct answer
upvoted 1 times
...
camps
1 year, 2 months ago
Selected Answer: A
A. True. A Terraform local value can reference other Terraform local values. Local values in Terraform are used to create intermediate values that can be used to simplify complex expressions or avoid duplicating values in the code. They can reference other resources and values within the Terraform configuration.
upvoted 1 times
...
Abuu
1 year, 4 months ago
Selected Answer: A
True; Terraform local values can reference other Terraform local values. This is useful for sharing common values between resources, such as defining a common name or set of tags. When referencing other local values, Terraform will automatically look for the referenced value and substitute it in the configuration. This helps avoid repetition and makes Terraform configurations easier to maintain.
upvoted 1 times
...
eduvar4
1 year, 9 months ago
Selected Answer: A
https://developer.hashicorp.com/terraform/language/values/locals#declaring-a-local-value
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago