Closed jgrumboe closed 1 year ago
@nimrodkor @tsmithv11 @rotemavni WDYT?
Hey, author of that medium post here 👋 FWIW I really like this feature request, definitely less work than my solution (for the user anyway)
Thanks, @jgrumboe! We'd appreciate a contribution for this!
Hey @jgrumboe :)
I've just opened a PR for this enhancement (sorry @kartikp10 that I stole it from you 🤓),
I'm thinking now about the merge tags use case -
If a user with existing tags starts to use the new tag-prefix
flag:
Thanks FYI @tsmithv11
Hi @ChanochShayner , cool you jumped on it 🙂
That's a good question about how to deal with existing yor tags. I didn't think about it as I would be the "newjoiner" and wouldn't have any existing yor tags.
I think the easiest option development-wise would be 3) adding the prefixed tags to the existing ones, but that would lead to a lot of work for the users to get rid of the old tags. Maybe additional command-line parameters like "--override" or "--merge" could be implemented to give the user the option to select their fit.
@jgrumboe @mik3h0 I've just merged the PR 🙂
Is your feature request related to a problem? Please describe. Yes, the problem is described in this blog post https://gsd.fundapps.io/how-we-make-yor-work-with-terraform-caller-and-child-modules-22216afd775d where the author wants to tag remote module resources and the module-calling resource. Therefore he needs to remap the "incoming" tags from the caller.
Describe the solution you'd like Yor should support a
--prefix
(or similar) option which would generate prefixed tags. This way one could runyor tag -d . --prefix "module_"
for the module terraform code and would getmodule_yor_trace
,module_git_commit
and so on. The caller terraform code would runyor tag -d .
as usual. No remapping is needed as the caller tags won't overwrite module tags.Describe alternatives you've considered The alternative is already described in the blog post mentioned to remap values.