I’ve been getting to grips with terragrunt quite well as I’ve been using it extensively for the last 6 months. For most things it is great, but there are a couple of things I cannot figure out.
If I want to use a module from the terraform registry, is there any benefit at all in being able to pull that with one line of code using
source other than just being able to change the version at any time? The reason I am asking is that I have tried two ways in using modules but neither seems to be the perfect solution.
There is the method you have outlined in your example for Consul here: https://github.com/gruntwork-io/terragrunt-infrastructure-modules-example/tree/master/consul which requires you to build a
outputs.tfand basically extrapolate out the variables again, so that you can define in your
terraform.tfvars“root module” file along with the terragrunt config.
When using this method, which requires you to at a minimum specify the required variables, what happens if you want to then go ahead and override a non-required variable in your
terraform.tfvarsfile? Do you need to then add this variable to the
main.tfand also call out the
variables.tfbefore you can use it in your
If so, then isn’t it much easier just to download the entire module from github and just use it locally (minus the ability to easily update the version)?
Pulling the registry/github module directly into your
terraform.tfvarsfile and not using the module locally at all. This means you save time by being able to run the module fairly quickly, but as far as I can see there is no way to use
data.terraform_remote_statewith this method. I tried creating another
.tffile alongside the
terraform.tfvarsfile so that terragrunt can pull it in while building the
.cachebut this did not work because we are using
datato override user-defined variables.
Please help me understand this better if you can!