Open moosahmed opened 4 years ago
Does it work if you have a before_hook
that calls tfswitch
?
Does it work if you have a
before_hook
that callstfswitch
?
I've tried, but it looks like it tries to find the terraform_binary before it executes hooks. Do you have a working example?
What error are you seeing? Can you share the logs? Would also help if you can share the before_hook
configuration.
Do you have a working example?
We don't use tfswitch
so I'm kind of working off the docs here. If I understand how tfswitch
works, there should always be a terraform
in the PATH that resolves to some version, which may or may not be correct. This should pass the terraform_binary
check.
The way the above proposal works is that it will call tfswitch
in the before_hook
and update that symlink before terragrunt
calls it for the actual command. So in theory that should work.
I might be able to provide some more pointers if you can share your config and logs.
when not using terragrunt we used to use a terraform block with required version defined, so tfswitch could automatically download and use the terraform to meet the requirement.
Something like this would exist in versions.tf in the directory where the module block is defined and where
terraform apply
is run.versions.tf
tfswitch would then keep terraform updated for the newest 0.12.X that is available.
How can this be used with terragrunt?