Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 213

Variables declared within a module are accessible outside of the module.

    Correct Answer: B

    Variables declared within a module are not accessible outside of the module by default. To access these variables outside of the module, they need to be explicitly exposed through output values. Output values are used to make certain values within a module available to other modules or configurations.

Discussion
Mail1964Option: A

It is a poorly worded Q. Using output they are accessible and not without. But the Q only asks if they "are accessible" which is A. If the Q added "by default" on the end, then it would be B.

campsOption: B

B. False Variables declared within a module are not accessible outside of the module by default. To expose the values of those variables to other modules or the root configuration, you need to use output values. Output values are declared using the output block in the module, and they serve as a way to expose certain values from a module so that they can be consumed by other modules or configurations.

mocnakOption: A

It is a bit confusing question, as you pointed out, they are accessible if they are passed out as output variables. so yes, they are. I am not sure if that's the "catch" of this question ..

InformationOverloadOption: B

these variables are not automatically accessible outside of the module unless they are explicitly passed out as output variables

princajenOption: B

B. False. Variables declared within a module have module-level scope and can only be accessed within the module. If a variable in a module needs to be accessed outside of the module, it must be exposed as an output.

lezginoOption: B

B is correct