-
-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass a file as an argument to a terraform module #330
Comments
Could you update your module to take in a |
hi @brikis98, Yes i have full control on the module, and passing the file path is an option i have considered. But is there a way to use a As far as i remember with terragrunt the module's code is downloaded and executed in a tmp directory so having access to the It would also be best to avoid referring to the env itself in the |
Use a relative path with one of the Terragrunt helpers to create an absolute path. Example: terragrunt = {
terraform {
source = "..."
extra_arguments "path" {
commands = "${get_terraform_commands_that_need_vars()}"
arguments = ["--var", "TF_VAR_file_path=${get_tfvars_dir()}/../service/config.xml"]
}
}
} |
okkkk, i see, the solution is to pass the file path within a terragrunt block and not inside a plain Too bad it hides the declaration of this variable inside the terragrunt specific directive : Anyhow I don't see any other way around. maybe a quick addition to the doc illustrating the use case would be worth it ! Thanks for your help 👍 cc: @rgarrigue |
General-purpose interpolation in |
Duly noted!
Le ven. 27 oct. 2017 à 14:55, Yevgeniy Brikman <notifications@github.com> a
écrit :
… Closed #330 <#330>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#330 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALcep2DGgPMzx8CNw16pLEroattmChmiks5swdLYgaJpZM4QI32O>
.
|
for whomever would find this, the exact syntax would be:
|
i fixed a typo above: we don't need to pass a prefixed TF_VAR_xxx var as we're directly using Terraform's |
Ah, of course, good catch :) |
hi,
I wan't to keep my project DRY but have a module that requires a config file as an argument (used with terraform's
${file(..)}
used in atemplate_file
datasource).tfvars
files do not support multiline variables as per terraform documentation.Furthermore it's often preferable to pass a full file as an argument rather than putting it inlined with
EOF
directive in a.tf
file.Currently the aforementioned file is contained inside the terraform's module itself, what would be my best option to move it back inside my terragrunt's
live
directory ?thx,
The text was updated successfully, but these errors were encountered: