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
826 stars 123 forks source link

Tagging based on workspace prefix / suffix? #335

Closed andyshinn closed 1 year ago

andyshinn commented 1 year ago

Is your feature request related to a problem? Please describe. I would like to tag based on the workspace prefix. For example:

In the case of workspace comqa I would like to tag with:

Or in the case of workspace govprod I would like to tag with:

I couldn't find a way to do this.

Describe the solution you'd like I suppose this could be a sort of matcher for matches. Maybe there is a workspace matcher that can apply tags based on workspace such as:

name: env
value:
    default: prod
filters:
    workspaces:
      - comprod
      - govprod

Maybe with some way to do simple globs or prefix / suffix matching:

name: segment
  matches:
    - com:
        workspaces:
          prefixes:
              - com
name: env
  matches:
    - prod:
        workspaces:
          suffixes:
              - prod

Describe alternatives you've considered I haven't tried any solutions as I haven't found anything in documentation to suggest it is currently possible.

Additional context Thanks for considering!

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