-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Enhancement]: Allow setting ignore_tags via environment variables #35243
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.62.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
We would like to be able to configure the
ignore_tags
parameter of the AWS provider using environment variables.We have a process that applies a tag to AWS resources, and want to prevent this tag from being overwritten every time a Terraform plan is applied. Our organization has thousands of different instances of the AWS provider across several hundred repositories, making it difficult to ensure that every instance has
ignore_tags
configured correctly.If
ignore_tags
were configurable via an environment variable, we could set it globally via a shared Terraform Enterprise variable set, eliminating the need to modify every instance of the AWS provider.I propose the following environment variables:
TF_AWS_IGNORE_TAGS_KEYS=<comma-separated list of keys>
TF_AWS_IGNORE_TAGS_KEY_PREFIXES=<comma-separated list of key prefixes>
HCL string tuples would be another option for the format of the variables.
There is an additional question of how to resolve explicit specification of
ignore_tags
with specification via environment variables. I see a few options:ignore_tags
argument overrides both environment variables, regardless of whetherkeys
,key_prefixes
, or both are specified.ignore_tags
argument overridesTF_AWS_IGNORE_TAGS_KEYS
iff it has akeys
argument, andTF_AWS_IGNORE_TAGS_KEY_PREFIXES
iff it has akey_prefixes
argument.ignore_tags
are merged with those specified via environment variables, rather than fully overriding them.If we go with option 1 or 2, it would still be possible for module owners to explicitly merge the lists specified in
TF_AWS_IGNORE_TAGS_KEYS
orTF_AWS_IGNORE_TAGS_KEY_PREFIXES
with an additional set of keys or prefixes viasetunion()
. With option 3, there would be no way for module owners to remove keys or prefixes from the ignore list, which may be regarded as a feature or limitation, depending on use case.My preference is for option 3, merging, but I'm not sure which is more in line with Terraform's overall design philosophy. It would also be possible to specify override/merge behavior via an additional environment variable, although this would complicate things more than may be desirable.
Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
Would you like to implement a fix?
Yes
The text was updated successfully, but these errors were encountered: