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

Allow to add inline ignore for tagging terraform resource #299

Closed
tommy31 opened this issue Aug 26, 2022 · 5 comments
Closed

Allow to add inline ignore for tagging terraform resource #299

tommy31 opened this issue Aug 26, 2022 · 5 comments
Labels
wontfix This will not be worked on

Comments

@tommy31
Copy link

tommy31 commented Aug 26, 2022

To prevent resource deletion when using depend_on meta argument we would like to ignore some resource tagging.

The best solution should be to add inline comment to specify to ignore tagging

Solution 1:

# main.tf

# yor:ignore
module.vpc_dev {
...
}

Solution 2:

# main.tf

# yor:ignore:module.vpc_dev

module.vpc_dev {
...
}

module.vpc_prod {
...
}
@jgrumboe
Copy link

jgrumboe commented Sep 2, 2022

Hi @tommy31
I'm not a maintainer, but I would like to understand the need of this. What do you mean with prevent resource deletion?

To prevent ressource deletion when using depend_on meta argument we would like to ignore some ressource tagging.

Could you give an example behavior of what's happening?

@lonegunmanb
Copy link
Contributor

Hi @jgrumboe , I think what @tommy31 means is skip tagging some resource by adding ignore annotation in comment. For his solution 2, the module.vpc_dev won't be tagged.

@tommy31
Copy link
Author

tommy31 commented Sep 6, 2022

Hi @jgrumboe / @lonegunmanb,

We had an issue after adding Yor to an old project who use a lot of depend_on between terraform ressources and in our case adding new tag to some ressources force other ressources that depend on it to be recreated, wich in our case are too critical.

That's why, as @lonegunmanb says, we would like a way to tell yor to avoid tagging some ressource and a common way to do it is by using inline comment.

Hope this help you to understand my needs.

@JamesWoolfenden JamesWoolfenden changed the title Allow to add inline ignore for tagging terraform ressource Allow to add inline ignore for tagging terraform resource Dec 6, 2022
@JamesWoolfenden
Copy link
Contributor

This requires modification of how the HCL parser works, there is already a method for excluding untaggable resources from analysis although this does require a code change.

@stale
Copy link

stale bot commented Feb 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Feb 15, 2023
@stale stale bot closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants