auto-tag
auto-tag copied to clipboard
Don't hard code role names in the lambda
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.
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.