Interview Prep/Terraform/Variables, Locals, Outputs and Types

How do you pass several var files and what is the result of overlapping keys?

IntermediateConceptVariables, Locals, Outputs and Types
Answer

Repeat -var-file. They are processed in order and later values override earlier ones, as do -var flags mixed in at the position they appear.

terraform plan -var-file=common.tfvars -var-file=prod.tfvars -var="replicas=6"
All Terraform questions Roadmap: Terraform

More on Variables, Locals, Outputs and Types