Input variables and validation
Variables make configuration adjustable with explicit types, defaults, descriptions, and optional validation. Sensitive marking affects display but is not encryption. Values supplied by variable files or environment need deliberate precedence and protection, especially when automation selects an environment. For example, a region variable has type string; a replicas variable has a validation requiring a positive integer.
A region variable has type string; a replicas variable has a validation requiring a positive integer.
A module accepts replicas as an integer and environment as a string. At plan time, callers supply values through reviewed files or flags. Type constraints reject incompatible shapes; validation can reject a numeric value outside the module's intended range. The resulting plan then shows how those accepted choices affect resources.
An input variable is a caller-supplied parameter. A default supplies a fallback when permitted. Validation expresses additional rules, such as requiring replicas greater than zero. Document units and meaning: a number called timeout is ambiguous without seconds or milliseconds. Sensitive marking limits some displays but does not encrypt the value in state or every output consumer. Flexible inputs make reuse possible, yet too many loosely validated options create difficult combinations. Expose meaningful decisions, keep safe defaults where appropriate, and avoid putting real secrets into a committed variable file merely because it is convenient.
A region variable has type string; a replicas variable has a validation requiring a positive integer.
Do not overlook this operational distinction: Values supplied by variable files or environment need deliberate precedence and protection, especially when automation selects an environment.