tfvar
tfvar copied to clipboard
Using `--var` in combination with `--var-file ` results in `--var` being ignored.
Using --var in combination with --var-file results in --var being ignored.
$cat my.tfvars
image_id = "xyz"
$tfvar . --var-file my.tfvars
image_id = "xyz"
$tfvar . --var=image_id="abc"
image_id = "abc"
## Not expected image_id should be "abc"
$tfvar . --var-file my.tfvars --var=image_id="abc"
image_id = "xyz"
##Ordering does not make a difference
$tfvar . --var=image_id="abc" --var-file my.tfvars
image_id = "xyz"
@shihanng Should this stay open?
Sorry for the (1 year 😓) late reply. I think it should follow the precedence as stated in https://developer.hashicorp.com/terraform/language/values/variables#variable-definition-precedence.
Will take deeper look when I am more available 🙏
Happy to accept PR.