-
-
Notifications
You must be signed in to change notification settings - Fork 981
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
Fold "extra_arguments" into terragrunt when using "include" to retrieve remote TF configurations #147
Comments
Ah, yea, that's not ideal. I think the way we are merging keys from I'm open to ideas here. One thing I've been considering is a new interpolation function:
The idea is that it returns the value of a variable terragrunt = {
lock = "${read_var_from_file("terragrunt.lock", find_in_parent_folders())}"
remote_state = "${read_var_from_file("terragrunt.remote_state", find_in_parent_folders())}"
terraform {
source = "git::git@github.com:foo/bar.git//app?ref=v0.0.1"
extra_arguments {
global = "${read_var_from_file("terragrunt.terraform.extra_arguments", find_in_parent_folders())}"
}
}
} This may also solve #132, as it will allow you to reuse values of arbitrary variables (not just Terragrunt ones) from your
|
This is something I would like to see as well. If we could come to an agreement on a solution, I could put some work into making a PR. |
@andrewrynhard My best guess for a solution is the one in the comment above yours: a I want to work on both of these, but have been utterly buried recently, and just haven't been able to find the time, so I'd be grateful for PRs! |
Great, I will take a look and see what I can get done this week. |
This sounds like a very needed feature for reducing duplication. Any update on this? |
Nothing on my end. I submitted a flurry of PRs recently to update Terragrunt to support Terraform 0.9 and add a few other critical features, but have not had time for this one. @andrewrynhard, have you had a chance to take a look? |
I have not had a chance yet. Hopefully soon. |
A deep merge of the terraform key would be really nice to solve this! |
On our fork, we made a lot of enhancements including:
Ultimately, our team only have to include that config file in their project = "projectname"
terragrunt = {
include {
source = "${discover("bootstrap", var.env, "default")}"
}
} But having a new feature is one thing. Make a good PR from it with complete documentation and tests is another thing. We are trying to find time to package our changes in complete PRs to make them available to the root project. |
@jocgir Wow, that's fantastic 👍 We'd love to hear more about each of these and get many of them into terragrunt itself. Please let me know if there's anything we can do to make that easier! Of course, we should discuss each item to make sure it's a good fit for the general Terragrunt community before you do the work to submit a PR, but I suspect a lot of these will be useful for a lot of people! |
I like the I would use it in the parent tfvars file's I also see lots of other use cases for a I also like the ideas done/proposed by @jocgir , but I would hate to hold up implementation of a simple function while waiting on that much larger work. |
…rguments Copied @jocgir's base implementation from https://github.com/coveo/terragrunt Added documentation and unit tests.
After investigating adding the I then looked at @jocgir's deep merging approach for BTW, you can "unset" an |
I believe PR #235 fixes @rkr-kununu's original request. So this can probably be closed. Separate individual issues could be opened for the items implemented by @jocgir |
@philsttr Good point. New issues for the other items discussed in this thread are more than welcome. |
@jocgir are there any plans to work towards some PRs from your fork? I found that your logging system is a major improvement, however, diff-ing your codebase against the current master produces an overwhelming set of changes. Are there pieces that could be incorporated with relative ease given some community involvement? |
So, I've got the following setup:
The contents of
/terraform.tfvars
is:The contents of
/preview/terraform.tfvars
is:The idea being that in app I would have access to
var.account_id
. This is of course not possible (currently) because the terraform source-block will override the terraform extra_arguments-block.The solution described in #143 could be applied (put my configuration into a separate tfvars), but it would mean I'd need to cut-and-paste the extra_arguments blocks into /preview/terraform.tfvars (and future staging environments).
The text was updated successfully, but these errors were encountered: