While following the steps in this guide , the ami_prefix variable loads fine if I use the --var-file flag, but once I change the file name from [NAME].pkrvars.hcl to [NAME].auto.pkrvars.hcl , and remove the flag, the command stops working (aka only uses the default value)
myTest.pkr.hcl
[...]
variable "ami_prefix" {
type = string
default = "my-packer-test"
}
[...]
variables.auto.pkrvars.hcl
ami_prefix = "my-packer-test-var-from-file-auto"
Commands tried:
packer build --var-file variables.auto.pkrvars.hcl myTest.pkr.hcl
→ results in the correct result
packer build myTest.pkr.hcl
→ results in the incorrect result (in this case, it reads the default value, and not the file)
Can anyone provide insight into why the auto isn’t working as expected? Am looking to learn, so don’t hesitate to comment. Thanks for your time