Closed jrsmith17 closed 3 years ago
Hard to guess without being able to see your code! Perhaps you can share a reproducible case?
I actually managed to figure it out from looking at my code and the source code for Terragrunt. I accidentally forgot to rename generate "FilenameA"
to generate "FilenameB"
when copy pasting for the new template.
Would you accept a PR around making this a little obvious in the output? I'd be happy to put in a little work to make it a bit more obvious for others and future me.
Glad to hear you got it sorted. Anything that helps with error handling or usability sounds great! What did you have in mind?
I was thinking something along the lines of catching the case where a generate name was already used, print out a warning saying something like "Name foo has already been used in File A Line 17. Name foo in File A Line 37 conflicts with that. Only the later name will generate."
Just to clarify something... If your code has:
generate "<NAME>" {
path = "<PATH>"
}
Is the issue you saw with a duplicate <NAME>
or <PATH>
?
I had a duplicate <NAME>
.
Oh... Hm, it seems like a duplicated <NAME>
should be an error. I can't think of a use case where allowing that would be desirable. @yorinasub17 WDYT?
Ah yup that should definitely be an error!
Just now getting to this after work. Should I move forward (probably this weekend) with working on a PR? Would you rather handle it internally?
A PR to make this an error is very welcome!
@denis256 could you look into this one?
As the title states, Terragrunt has stopped overwriting one of my variables.tf files even though if_exists = "overwrite" is set on the module. This feature in conjunction with templates was the entire reason I am using Terragrunt, so you can imagine my distress. To make this even more unhelpfully confounding, this behavior has been consistent across all my modules, even the ones I wasn't working on at the time when the failure started.
An extra wrinkle to this bug might be my setup. Terra* didn't really meet my work project's requirements so I had to write a bash script to make the functionality do as I want. I can't share my exact setup, since it's work, but here's the gist of what I do.
base/ variables/ (per aws account variables in json files, that get exported by bash and should be picked up by Terragrunt's get_env, but that suddenly stopped working) deploy.sh (the bash script in question) modules/ moduleA/ submoduleA/ variables.tf and friends terragrunt.hcl
My current solution is to manually place variables from the JSON files into the variables file. This obviously is suboptimal, so I hope someone has a clue as to what caused the sudden shift.