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
789 stars 120 forks source link

Group tags together using nested JSON encoding #524

Open BHoggs opened 1 month ago

BHoggs commented 1 month ago

Is your feature request related to a problem? Please describe. With the number of tags that yor adds, we're starting to hit platform limitations when adding a few tags of our own. For example, some Azure resources only support a maximum of 15 tags.

Describe the solution you'd like Azure recommends if you're running out of tags, to nest a JSON blob as the tag value.

Add an option to enable "grouping" of tags by using using this method, so that all of the git tags can be grouped into a single tag.

e.g.

  tags = {
    "git_commit"           = "..."
    "git_file"             = "..."
    "git_last_modified_at" = "..."
    "git_last_modified_by" = "..."
    "git_modifiers"        = "..."
    "git_org"              = "..."
    "git_repo"             = "..."
  }
  # Becomes:
  tags = {
    "git" = jsonencode({
      "commit"           = "..."
      "file"             = "..."
      "last_modified_at" = "..."
      "last_modified_by" = "..."
      "modifiers"        = "..."
      "org"              = "..."
      "repo"             = "..."
    })
  }

Describe alternatives you've considered Filtering out tags

Additional context https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources#limitations

stale[bot] commented 1 week 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.