Skip to content
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

Request to add delete feature of tags applied via terratag #170

Open
RT235 opened this issue Apr 4, 2023 · 6 comments
Open

Request to add delete feature of tags applied via terratag #170

RT235 opened this issue Apr 4, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@RT235
Copy link

RT235 commented Apr 4, 2023

I would like to be able to remove any tags applied via terratag.

@yaronya
Copy link
Contributor

yaronya commented Apr 4, 2023

Hi @RT235
Thanks for the feedback.

Can you please explain your use case a bit further?
Terratag creates new terratag.tf files and keeps the old files as tf.bak files. Perhaps using the old files is something that could work for ya?

@RT235
Copy link
Author

RT235 commented Apr 4, 2023

Hi,

I have added several test tags whilst learning the tool, but would like to revert them all with a single command line rather than reverting to the tf.bak files if this is possible?

@Smelton01
Copy link

Smelton01 commented Apr 6, 2023

Hello @yaronya
I was recently considering this tool for a task in my job and we want to tag our resources gradually and eventually use the default tags option terraform provides to tag everything uniformly.

This means we will eventually want to revert the tagging that was done with terratag to clean up our config.
I basically hacked a forked version of terratag for this purpose and I have a working prototype with flags to do exactly this.

but would like to revert them all with a single command line rather than reverting to the tf.bak files if this is possible?

If this is something you guys can consider adding, I can do some refactoring, clean up my code and create a PR with the suggested additions.

Edit: The main issue is that our terraform code will likely change from the time we create the backups to when we want to revert so we can't just use the backup files.

Let me know what you think?

@TomerHeber
Copy link
Collaborator

Hi @Smelton01 ,

I'll be happy to review it.
Note: this can also be done as a script.

@yaronya
Copy link
Contributor

yaronya commented Apr 23, 2023

As @TomerHeber suggested, if you already got a working version of it - then we'd be more than happy to accept a contribution from you 🙂

Please make sure it includes the appropriate tests tho.

@yaronya yaronya added the enhancement New feature or request label Apr 23, 2023
@Smelton01
Copy link

Smelton01 commented May 1, 2023

Hello, sorry for the delay, I have been quite busy recently but I would definitely love to contribute.

You can go ahead and assign me to this issue and I will try to get a PR out in the next week or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants