
Extract hardcoded values into typed variables - string, number, bool, list, and object - with defaults and validation rules that reject bad values with defined messages, proving that mistyped and out-of-range inputs fail at plan time while defaults and supplied values flow into the resource verbatim.
Set one variable through defaults, an environment variable, an auto-loaded tfvars file, an explicitly passed tfvars file, and a command-line flag, capturing a plan at each rung to prove the precedence order - with the winning command-line value observable in the applied resource.
Centralize a derived naming expression in a local consumed by multiple resources, and expose described outputs including a sensitive one - reading them back as a plain listing with the sensitive value redacted, a single raw value, and machine-readable JSON where the sensitive value is present.
Build a fully parameterized configuration: typed and validated variables across primitive and complex types, every value source exercised with its precedence proven rung by rung, shared expressions defined once as locals, and a described output surface with sensitive redaction - consumed to stand up a working deployment from external parameters.