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

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

If a module uses a local values, you can expose that value with a terraform output.

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

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Bere
Highly Voted 1 year, 3 months ago
Selected Answer: A
Code example: variable "input" { description = "An input variable" default = "Hello" } locals { local_value = "${var.input}, World!" } output "greeting" { description = "A greeting message" value = local.local_value } Outputs: greeting = "Hello, World!"
upvoted 11 times
...
SilentMilli
Most Recent 1 month, 4 weeks ago
Selected Answer: A
If a module uses local values, those values can be exposed using the "terraform output" directive. By using the terraform output directive, you can define an output for a module that provides information about the local values used within the module. This information can then be consumed by other parts of the Terraform configuration, allowing you to make use of the values that have been set within the module. To expose a local value, you would define an output block in the module, specifying the name and value of the output, and then reference the output in other parts of your Terraform configuration using the "terraform output" data source.
upvoted 4 times
...
gargaditya
1 month, 4 weeks ago
Selected Answer: A
1. Output values make information about your infrastructure available on the command line, and can expose information for other Terraform configurations to use. Output values are similar to return values in programming languages. 2.Basic Syntax: https://drive.google.com/file/d/1td5DcyZ-7iHL3Xhpwep4deEEfKbC7DkT/view?usp=sharing 3.Using Output Values with Modules(logical concept described in diagram below): https://drive.google.com/file/d/1tbYWsCSev063ibz9Pv9poqViOY6fAAsG/view?usp=sharing Basically,the question is narrowed down to exposing locals from the root module(can be any resource attribute in general).
upvoted 1 times
...
HarshPatel198
1 year, 2 months ago
Selected Answer: A
Bere is right
upvoted 1 times
...
Jayanth
1 year, 3 months ago
A. True
upvoted 1 times
...
Busi57
1 year, 4 months ago
Selected Answer: A
Teams A
upvoted 1 times
...
VSMu
1 year, 4 months ago
Answer A. # Output the local variable as an output value output "instance_public_ip" { value = local.instance_public_ip }
upvoted 1 times
...
SammySunny
1 year, 5 months ago
Why not B? The documentation says "A local value can only be accessed in expressions within the module where it was declared"
upvoted 1 times
HMthyl
1 year, 4 months ago
Confirmed using a project, A is true. That definition threw me too - but if you explicitly output the local value it can be accessed as expected
upvoted 3 times
...
...
IK912
1 year, 5 months ago
Answer Definitely A
upvoted 1 times
...
karendavtyan
1 year, 6 months ago
Selected Answer: A
A. true
upvoted 1 times
...
Tanacet
1 year, 9 months ago
Selected Answer: A
It is A
upvoted 1 times
...
ssanjayt
1 year, 10 months ago
Selected Answer: A
A is correct
upvoted 1 times
...
jj22222
2 years ago
Selected Answer: A
A is correct
upvoted 1 times
...
hectordj
2 years, 1 month ago
Selected Answer: A
A is correct
upvoted 1 times
...
poojithakadiyala
2 years, 1 month ago
A is correct
upvoted 1 times
...
daaww
2 years, 2 months ago
Selected Answer: A
A is correct
upvoted 3 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 ...