Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Don't hard code role names in the lambda #79

Open
jangroth opened this issue Feb 27, 2020 · 1 comment
Open

Don't hard code role names in the lambda #79

jangroth opened this issue Feb 27, 2020 · 1 comment

Comments

@jangroth
Copy link

jangroth commented Feb 27, 2020

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.

@ecout
Copy link
Contributor

ecout commented Apr 22, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants