-
Notifications
You must be signed in to change notification settings - Fork 44
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
Support multiple runs to add/remove tags #211
Comments
Hi @defenestration , Thank you for reaching out. Imagine you have a CI/CD pipeline for terraform/tofu. It sounds like you prefer to commit to a repo the changes terratag makes to your files. That's a viable option for sure. But I would love to learn more about your use-case and why you prefer to do it in this manner. Thanks! |
The main thought is, don't want to add another app into to the CICD process. While woudlnt' be hard to do, there can be security concerns there. One thing I also found about running terratag, that merging from existing tag blocks changed the order, the terratag ones were merged last, meaning they override the ones sent on the resource. This wasn't desired in our setup either. |
I appreciate you taking the time to explain your use case. It helps us understand the need for this feature. While we agree that the feature you've described would be useful, we've identified a key challenge in reliably distinguishing between append and replace operations. This distinction is crucial for accurate and predictable behavior, and we haven't yet found a robust way to define it in all situations. Because of this complexity, we don't have immediate plans to implement this feature. We want to avoid introducing functionality that could lead to unexpected or inconsistent results. However, we'll keep this request in mind as we continue to develop Terratag and explore potential solutions to this challenge. If you have any further insights or ideas on how to address the append/replace ambiguity, we'd be very interested to hear them. The best option at the moment is to add terratag to your CI flow: |
Is your feature request related to a problem? Please describe.
I tested running a few times to add tags. Since my files are backed by git i used the
-rename=false
flag. Thelocals
block added to each file was fine. However, the resources with tags ended up with newmerge
functions each time:+ tags = merge(merge(local.terratag_added_main, local.terratag_added_main), local.terratag_added_main)
Describe the solution you'd like
Terratag should be able to detect the merge block and not add additional ones.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Seems like the intent is to run once and modify from there, but this doesn't seem to be called out in the docs really.
Additional context
Add any other context or screenshots about the feature request here.
Seems like it would be useful also to have an option to manage a single terratag local out of one file in the repo, rather than adding a different local to each separate file. Being able to rename or set the local name used would also be useful.
The text was updated successfully, but these errors were encountered: