Support for terraform.tfvars was removed in terragrunt 0.19 only because of https://github.com/hashicorp/terraform/issues/19424
That required everyone to basically rename the file to terragrunt.hcl and make some other adjustments. It required creating the inputs{} block with the variables, which are then get converted to env vars and then to actual vars by terraform. As this transformation doesn't always work well, we have to sometimes have two files: terraform.tfvars and terragrunt.hcl, keeping the variables set in terraform.tfvars and terragrunt configuration set in terragrunt.hcl.
There have been some other features added with terragrunt.hcl, for example terraform functions, but they are not used always. At least I haven't found a way to use this functionality at all.
Instead, terragrunt can:
terraform.tfvars. Check for the terragrunt variable there. If it's there then generate a file called terragrunt.tf with this content: variable "terragrunt" {}.terragrunt.hcl file and parse it as usual.Moving away from terraform.tfvars was recommended by HashiCorp in https://github.com/gruntwork-io/terragrunt/issues/466. I tend to agree, as that's a format native to Terraform, and it's likely to have other backwards incompatible changes in the future.
Moreover, I'm not a fan of code generation. It always sounds simple, but tends to introduce complexity. Just off the top of my head:
terraform.tfvars, parse it, find a terragrunt variable, then find a possible source = "xxx" param, then either check out xxx or look at the .tf files in the current working dir, scan all of those, parse all of those, and make sure none of them declare a terragrunt variable already..terragrunt-cache makes more sense, but only works for users with source = "xxx" params that require downloading code into that dir. terragrunt.tf already exists?terragrunt.tf?So, overall, I'm not sure this is a road we want to go down.
Most helpful comment
Moving away from
terraform.tfvarswas recommended by HashiCorp in https://github.com/gruntwork-io/terragrunt/issues/466. I tend to agree, as that's a format native to Terraform, and it's likely to have other backwards incompatible changes in the future.Moreover, I'm not a fan of code generation. It always sounds simple, but tends to introduce complexity. Just off the top of my head:
terraform.tfvars, parse it, find aterragruntvariable, then find a possiblesource = "xxx"param, then either check outxxxor look at the.tffiles in the current working dir, scan all of those, parse all of those, and make sure none of them declare aterragruntvariable already..terragrunt-cachemakes more sense, but only works for users withsource = "xxx"params that require downloading code into that dir.terragrunt.tfalready exists?terragrunt.tf?So, overall, I'm not sure this is a road we want to go down.