auto-tag icon indicating copy to clipboard operation
auto-tag copied to clipboard

Don't hard code role names in the lambda

Open jangroth opened this issue 4 years ago • 1 comments

I'm working in an environment where we use naming conventions to indicate ownership (in addition to tagging).

Would love the ability to prefix autotag's role paths like so:

  AutoTagMasterRole:
    Type: AWS::IAM::Role
    Properties:
      RoleName:
        Fn::Sub: "${AWS::StackName}"
...
      Path: "/xyz/gorillastack/autotag/master/"

Unfortunately this is also hard coded in the lambda:

const MASTER_ROLE_PATH = '/gorillastack/autotag/master/';

class AutotagDefaultWorker {
...

It would be great if the role path could be passed into the lambda. This would make CFN the only source of truth and thereby not require to rebuild the lambda.

jangroth avatar Feb 27 '20 20:02 jangroth

Roles are tricky, they're named after the STACK's id automatically by CF and they ALREADY have a limit that's almost reached. If you add more stuff to that string you might end up breaking the CF deployment because of the resource(in this case IAM role) limit. I've seen this happen in other projects.

ecout avatar Apr 22 '21 20:04 ecout