4

Is it possible to use both of these methods when defining a serverless file? I want to use serverless-iam-roles-per-function because I was running into Maximum policy size error from serverless framework

But rather than having an IAM role per function for all of my functions I want to do it for a few, the rest I would like them to use one role until the policy size is reached. I tried defining a role to a few functions and the rest of the functions I left blank so that it would use the iamRoleStatements defined at the provider level. The problem was that the few functions that I gave roles to are still included in the global role so I still reach the maximum-policy-size.

Is there a way to exclude a few functions from the global iamRoleStatements and only apply the functions to the roles defined by serverless-iam-roles-per-function?

Thanks in advance.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
justinseo
  • 61
  • 6

1 Answers1

0

"if iamRoleStatements are not defined at the function level default behavior is maintained and the function will receive the global IAM role. " is what it reads here https://www.serverless.com/plugins/serverless-iam-roles-per-function

systemdebt
  • 4,589
  • 10
  • 55
  • 116