bridgecrewio / yor

Extensible auto-tagger for your IaC files. The ultimate way to link entities in the cloud back to the codified resource which created it.
https://www.yor.io
Apache License 2.0
808 stars 123 forks source link

Factor in provider version tag compatibility #431

Closed ebarti closed 9 months ago

ebarti commented 11 months ago

Is your feature request related to a problem? Please describe. We face issues with your when using somewhat-old AWS providers. Certain resources do not accept tags in old version (eg. aws_glue_catalog_database at 3.69), but yor tries to add them anyway.

Describe the solution you'd like Yor should verify tag compatibility per resource and provider version.

Describe alternatives you've considered We currently are forced to upgrade provider versions for compatibility.

Additional context N/A

ChanochShayner commented 11 months ago

Hey @ebarti :)

You can use flags to skip the problematic resources - --skip-resource-types to skip specific types, or --skip-resources to skip resources by name.

ebarti commented 11 months ago

I am willing to contribute this as a feature if you think it would be worth implementing. IMO it would make the tool more seamless, but I have not thought about how complex it might be to implement (especially if providers iterate through the various Hashicorp provider SDKs)

ChanochShayner commented 11 months ago

It will be a nice contribution! We have the function isBlockTaggable here - https://github.com/bridgecrewio/yor/blob/3e30ff383f4bde7b818626da5c77f0372ba1675e/src/terraform/structure/terraform_parser.go#L661

stale[bot] commented 10 months ago

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.