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

aws_resource_missing_tags errors when tags are provided via default_tags mechanism #117

Closed
mbazalik opened this issue May 28, 2021 · 2 comments

Comments

@mbazalik
Copy link

Aws have provided a new way of providing default tags through aws provider.

Right now those are ignored by aws_resource_missing_tags rule.

Would it be for the rule not to error if the tags are present in the provider?

Thank you

@wata727
Copy link
Member

wata727 commented May 29, 2021

Yes, this rule doesn't currently support the default tags.
https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider

On the other hand, this rule is just for manually solving the problem that should be realized with the default tags, and I think that this rule is no longer necessary. What do you think?

@rquadling
Copy link

We've just experienced this today. Our solution is to remove the rule from our .tflint.hcl. The reasoning for this is as follows (and may well have been explained already).

Our use case of this rule was to ensure that the developer had correctly tagged all the resources that could support tags.

This includes root resources as well as resources in modules.

This resulted in passing a block of tags around and ensuring correct .tf code for the tags (sometimes it is tags = map(string), sometimes it is a tag {} block per tag).

By moving the tags to the provider, our requirement has been met. All resources, regardless of how the tags are defined on the resource WILL get the tags defined in the provider.

This reduces all the merge(var.base_tags, {resource_specific_tag = "some specific value"} as well as the extra work for the pipelines to ensure all the tags exist.

And so, with all of that, there's no further use case for us of this rule.

It did involve a fair amount of work (several hundred resources all need to be stripped of their merge and just the resource specific tags left behind), but certainly well worth the effort.

@wata727 wata727 unpinned this issue Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants