-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
An inverse of ignore_changes or regex support #24908
Comments
Hi @mbrancato! Thanks for this feature request. Knowing that this is a common situation for tags in particular, the provider teams have started to introduce specific features to represent in a central place that certain tag patterns/prefixes are managed by other software. For example, in the AWS provider configuration you can use an provider "aws" {
region = "us-west-2"
ignore_tags {
key_prefixes = ["foobar:"]
}
} Focusing the solution on the specific use-case at hand means that this problem can be solved without waiting for a fully-generalized solution to be designed. The tag-specific mechanisms in providers avoid these problems by taking the relevant tags out of consideration by Terraform altogether. That is, rather than having Terraform see them and ignore them, Terraform just never sees them because the provider pretends they don't exist. If you're using a provider that doesn't yet have a feature like that |
@apparentlymart -- it's the opposite use case that is being requested here, it would be to add something like: |
Yes I’m asking for the inverse / opposite of ignore_changes. My problem is basically there are many teams who might have rights to add tags for different purposes. I have no control of how they name them etc. My goal is to allow me to specify the fields I always want to update. My only other option is to try and keep an updated list of tags to ignore, but that list seems to change periodically. |
Hi @mbrancato! Thanks for pointing out my misunderstanding. With that said, I think the most likely path for a feature like this being available in the near future is to request it as an AWS provider feature. They already put the internal infrastructure in place to support |
I’m not using the AWS provider but I understand your point. This was more a long-term enhancement request. Tags are the best use case but so is resource metadata like on Azure storage containers and Google storage objects. |
Current Terraform Version
Use-cases
The primary use case here is with tags, and the now multitude of apps / tools that have some management responsibility with Cloud and other platforms. Terraform users are left with two main options:
Both have problems. When ignoring all tags, that also means that Terraform will not update tags that Terraform itself created. If only specific tags are ignored, there is the possibility that config drift will be seen if some different management tool adds tags that were not previously known in the Terraform config.
So there is a use case where I as a Terraform user only care about my tags, but want to ignore all others used for internal billing, etc. - even if I don't know what those are or will be in the future.
Attempted Solutions
Proposal
I feel like this could be achieved with an inverse config block that takes precedence over ignore_changes:
or by supporting regular expressions:
References
The text was updated successfully, but these errors were encountered: