serverless-heaven/serverless-aws-alias

lambdaRole custom roles

bencodner opened this issue · 5 comments

alias deployments with function level roles/custom IAM roles don't work the same as core Serverless (Serverless empowers you to define custom roles and apply them to your functions on a provider or individual function basis). lambdaRole will use the currentRoles only if a provider role is present.

My service is setup to use the Cloudformation import value function for setting a KMS decryption role on a function. This role is an output of another stack (role: { "Fn::ImportValue": "KmsDecryptRoleName${self:custom.stage}" }). Without the alias plugin, the function gets the correct role and the rest of the functions get the default (Serverless generated) role.

After reading the code, I'm using a workaround of setting the role on the provider, however It's really only necessary on the one function.

Hi @bencodner . Thanks for reporting the issue. It is a good idea to have per function roles fully supported.
If you have an idea how to implement it (and have some time) you could help and provide a PR with a proper solution?

Oh, just saw the PR ;-) Thanks will review it soon.

Hello @HyperBrain, any update on this? Would be great to make the aliases work with serverless-iam-roles-per-function plugin

Hello @HyperBrain , I sent PR to fix this.
Hello @dsolonenko , my PR will work with serverless-iam-roles-per-function plugin.

Enase commented

closed by #157