mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
fix(dev): ensures that dev mode supports the serverless-iam-role-per-function plugin (#12633)
This commit is contained in:
parent
6ab69067bf
commit
4f2dc57eb8
@ -589,6 +589,22 @@ class AwsDev {
|
||||
functionConfig.environment.SLS_SERVICE = serviceName
|
||||
functionConfig.environment.SLS_STAGE = stageName
|
||||
functionConfig.environment.SLS_FUNCTION = functionName
|
||||
|
||||
// Make sure dev mode also supports the "serverless-iam-roles-per-function" plugin:
|
||||
// https://github.com/functionalone/serverless-iam-roles-per-function
|
||||
// Issue Ref: https://github.com/serverless/serverless/issues/12619
|
||||
if (
|
||||
functionConfig.iamRoleStatements &&
|
||||
Array.isArray(functionConfig.iamRoleStatements)
|
||||
) {
|
||||
const functionIamRoleStatements = functionConfig.iamRoleStatements
|
||||
|
||||
functionIamRoleStatements.push({
|
||||
Effect: 'Allow',
|
||||
Action: ['iot:*'],
|
||||
Resource: '*',
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// Disable observability if it's enabled
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user