Hey, I'm currently grappling with a challenge inv...
# general
m
Hey, I'm currently grappling with a challenge involving Terraform modules. My objective is to effectively utilize these modules across various deployments located in different places. However, I'm uncertain about the placement of the 'tvars' file. Should it be located within a subpath relative to the Terraform files? I'm considering altering the folder structure to accommodate this, but I'm also open to other potential solutions. What would you recommend in this scenario? Are there any practical workarounds or best practices I should consider?
c
This is definitely a bug. You ought to be able to have a
terraform_deployment
have a root module in another directory. I thought that would just work, but I must be loading the tfvars wrong in Pants. The layout I was testing against had the
terraform_deployment
and the root
terraform_module
in the same directory. I tested with multiple
terraform_deployment
in the same directory.
Also, to explain a bit about what's going on: the
root_module
field is the root Terraform module. If you were running this manually, you'd put this directory as the value of the
-chdir
argument. I hope that makes sense. there's also a doc on the TF backend in preview here: https://github.com/pantsbuild/pants/pull/20230