HashiCorpHashiCorp
TA-002-P · Question #101
TA-002-P Question #101: Real Exam Question with Answer & Explanation
The correct answer is B: False. A module variable declared with a default value does not require an external definition, as Terraform uses the specified default if no other value is provided.
Interact with Terraform modules
Question
If a module declares a variable with a default, that variable must also be defined within the module.
Options
- ATrue
- BFalse
Explanation
A module variable declared with a default value does not require an external definition, as Terraform uses the specified default if no other value is provided.
Common mistakes.
- A. The statement is false because the presence of a
defaultvalue means the variable is already 'defined' in terms of having a fallback value, removing the requirement for an external definition.
Concept tested. Module variable default values
Reference. https://developer.hashicorp.com/terraform/language/values/variables#default-values
Topics
#Terraform variables#Module variables#Default values#Variable definition
Community Discussion
No community discussion yet for this question.