TA-002-P · Question #389
Choose the best option from below to make Terraform code more user configuration-centric.
The correct answer is C. Input Variable. Input Variables are the Terraform feature specifically designed to allow users to customize a configuration without modifying the source code, making them the best choice for user configuration-centric designs.
Question
Choose the best option from below to make Terraform code more user configuration-centric.
Options
- AVariables
- BLocal values
- CInput Variable
- DModules
How the community answered
(33 responses)- A3% (1)
- B6% (2)
- C88% (29)
- D3% (1)
Why each option
Input Variables are the Terraform feature specifically designed to allow users to customize a configuration without modifying the source code, making them the best choice for user configuration-centric designs.
Variables is an overly generic term that encompasses both input variables and local values and does not specifically name the Terraform construct designed for external user input.
Local values (locals) are computed values reused within a module for internal simplification, not for accepting user-provided input from outside the configuration.
Input Variables in Terraform are the primary mechanism for accepting values from users or operators at run time, allowing configurations to be parameterized per environment or user without changing code. They are declared with 'variable' blocks and support defaults, types, and descriptions, making them purpose-built for user-facing configuration. This distinguishes them as the most user configuration-centric construct in Terraform.
Modules are containers for multiple resources that enable code reuse and organization, but they do not directly serve as the mechanism for user-driven configuration input.
Concept tested: Terraform input variables for user configuration
Source: https://developer.hashicorp.com/terraform/language/values/variables
Topics
Community Discussion
No community discussion yet for this question.