tfverch/tfvc

Add Terragrunt support

Opened this issue · 1 comments

Terragrunt is a widely adopted additional "layer" on top of Terraform to structure the code for different environments as well as it provides more functionality to keep Terraform clean.

In context of tfvc, Terragrunt allows for a few things:

  • direct specification of a Terraform module in a terrgrunt.hcl file via tfr:/// link
  • automated generation of required_providers and version constraints

For the support, I believe the first step would be to disable via a flag these two errors:
terraform FAILED Missing version constraints
provider 'aws' FAILED Missing provider definition

That'd allow TFVC show warnings for .tf files without failing hard. Next step would be to allow pointing to Terragrunt directories instead of Terraform directories although I'm aware that this'd be a much bigger chunk of code to add

Alternatively, we could run terragrunt run-all plan before running tfvc which generates directories with version and providers as well as downloaded dependencies. That might be easier to tackle, but would require recursive mode discussed in #47 as directories generated by terragrunt have random-ish names. So a recursive mode which look for .tf files only in a given directory structure would definitely work