serverless: TypeError: this.awsPackagePlugin.validateStatements is not a function

Without any changes to our serverless.yml file, the build started failing with a serverless error.

serverless.yml
# This file defines the serverless application deployed to AWS Lambda
#
# Other resources, such as databases, SNS topics, SQS queues, etc. should be
# are defined in $root/infrastructure/serverless.yml and deployed separately.
# This separation allows the application stack to reference outputs from the
# infrasturture stack, easing configuration.

service: app

plugins:
  - serverless-apigw-binary
  - serverless-iam-roles-per-function
  - serverless-pseudo-parameters

custom:
  stage: ${opt:stage}
  env: ${opt:env, self:custom.stage}
  configFile: serverless.${self:custom.env}.yml
  apigwBinary:
    types:
      - 'multipart/form-data'

  accountingApiToken: ${file(${self:custom.configFile}):accountingApiToken}
  apiGatewayRestApiId: ${file(${self:custom.configFile}):apiGatewayRestApiId}
  apiGatewayRestApiRootResourceId: ${file(${self:custom.configFile}):apiGatewayRestApiRootResourceId}
  apiProvisionedConcurrency: ${file(${self:custom.configFile}):apiProvisionedConcurrency, 1}
  aspnetCoreEnv: ${file(${self:custom.configFile}):aspnetCoreEnv}
  cloudFormationRole: ${file(${self:custom.configFile}):cloudFormationRole}
  cloudWatchMetricsEnabled: ${file(${self:custom.configFile}):cloudWatchMetricsEnabled, false}
  eventsDefaultEventSource: ${cf:${self:custom.infraCfStackName}.EventsEventBusDefaultSource}
  eventsEventBusArn: ${cf:${self:custom.infraCfStackName}.EventsEventBusArn}
  eventsEventBusName: ${cf:${self:custom.infraCfStackName}.EventsEventBusName}
  deploymentBucketName: ${file(${self:custom.configFile}):deploymentBucketName}
  documentConverterApiKey: ${file(${self:custom.configFile}):documentConverterApiKey}
  editSubmissionQueueArn: ${file(${self:custom.configFile}):editSubmissionQueueArn}
  editSubmissionTopicArn: ${file(${self:custom.configFile}):editSubmissionTopicArn}
  enableApiAutoScaling: ${file(${self:custom.configFile}):enableApiAutoScaling, false}
  eventTopicArn: ${cf:event-platform-${self:custom.stage}.EventTopicArn}
  postgresWriteConnectionString: ${file(${self:custom.configFile}):postgresWriteConnectionString}
  postgresReadConnectionString: ${file(${self:custom.configFile}):postgresReadConnectionString}
  formResponseFilesBucketName: ${file(${self:custom.configFile}):formResponseFilesBucketName}
  infraCfStackName: ${file(../infrastructure/serverless.yml):service}-${self:provider.stage}
  jwtSigningKey: ${file(${self:custom.configFile}):jwtSigningKey}
  mailgunApiKey: ${file(${self:custom.configFile}):mailgunApiKey}
  managerConnectionString: ${file(${self:custom.configFile}):managerConnectionString}
  messagingAttachmentsBucketName: ${file(${self:custom.configFile}):messagingAttachmentsBucketName}
  namePrefix: ${self:service}-${self:provider.stage}
  newSubmissionTopicArn: ${file(${self:custom.configFile}):newSubmissionTopicArn}
  paypalClientId: ${file(${self:custom.configFile}):paypalClientId}
  paypalClientSecret: ${file(${self:custom.configFile}):paypalClientSecret}
  raygunApiKey: ${file(${self:custom.configFile}):raygunApiKey}
  salesforceEditMappingBucketName: ${file(${self:custom.configFile}):salesforceEditMappingBucketName}
  salesforceMappingBucketName: ${file(${self:custom.configFile}):salesforceMappingBucketName}
  salesforceQueueArn: ${file(${self:custom.configFile}):salesforceQueueArn}
  stripeApiKey: ${file(${self:custom.configFile}):stripeApiKey}
  tableTemplatesBucketName: ${file(${self:custom.configFile}):tableTemplatesBucketName}
  vpc: ${file(${self:custom.configFile}):vpc}
  zapierQueueUrl: ${file(${self:custom.configFile}):zapierQueueUrl}
  guidestarApiKey: ${file(${self:custom.configFile}):guidestarApiKey}

provider:
  name: aws
  runtime: dotnetcore3.1
  stage: ${self:custom.stage}
  region: us-east-1
  vpc: ${self:custom.vpc}
  cfnRole: ${self:custom.cloudFormationRole}
  deploymentBucket:
    name: ${self:custom.deploymentBucketName}
    serverSideEncryption: AES256
  tracing:
    apiGateway: true # Enable active tracing
    lambda: true # Enable AWS X-Ray
  logs:
    restApi: true

  # Shared environment variables
  environment:
    EventBridge__EventBusName: ${self:custom.eventsEventBusName}
    EventBridge__Source: ${self:custom.eventsDefaultEventSource}

package:
  # We use a custom build artifacts for apis and lambdas
  individually: true

functions:
  api:
    role: apiRole
    memorySize: 2048
    timeout: 30
    provisionedConcurrency: ${self:custom.apiProvisionedConcurrency}
    package:
      artifact: Submittable.Api/bin/Lambda/netcoreapp3.1/Submittable.Api.zip
    handler: Submittable.Api::Submittable.Api.LambdaEntryPoint::FunctionHandlerAsync
    events:
      - http:
          path: /{proxy+}
          method: any
          cors: true
    environment:
      ASPNETCORE_ENVIRONMENT: ${self:custom.aspnetCoreEnv}
      CUSTOMCONNSTR_PostgresWrite: ${self:custom.postgresWriteConnectionString}
      CUSTOMCONNSTR_PostgresRead: ${self:custom.postgresReadConnectionString}
      CUSTOMCONNSTR_Manager: ${self:custom.managerConnectionString}
      CloudWatchMetrics__Enabled: ${self:custom.cloudWatchMetricsEnabled}
      DocumentConverter__ApiKey: ${self:custom.documentConverterApiKey}
      Mailgun__ApiKey: ${self:custom.mailgunApiKey}
      PayPal__ClientId: ${self:custom.paypalClientId}
      PayPal__ClientSecret: ${self:custom.paypalClientSecret}
      Raygun__ApiKey: ${self:custom.raygunApiKey}
      Raygun__Tags: 'env:${self:custom.stage}'
      Stripe__ApiKey: ${self:custom.stripeApiKey}
      S3__MappingBucket: ${self:custom.salesforceMappingBucketName}
      S3__EditMappingBucket: ${self:custom.salesforceEditMappingBucketName}
      S3__MessageAttachmentsBucket: ${self:custom.messagingAttachmentsBucketName}
      S3__FormResponseFilesBucket: ${self:custom.formResponseFilesBucketName}
      S3__TableTemplatesBucket: ${self:custom.tableTemplatesBucketName}
      Security__JwtSigningKey: ${self:custom.jwtSigningKey}
      SNS__SNSNewSubmissionTopic: ${self:custom.newSubmissionTopicArn}
      SNS__SNSEditSubmissionTopic: ${self:custom.editSubmissionTopicArn}
      ZapierQueue__QueueUrl: ${self:custom.zapierQueueUrl}
      Guidestar__Apikey: ${self:custom.guidestarApiKey}

  eventProcessor:
    events:
      - eventBridge:
          eventBus: ${self:custom.eventsEventBusArn}
          pattern:
            source:
              - ${self:custom.eventsDefaultEventSource}
    package:
      artifact: Submittable.EventProcessor.App/bin/Lambda/netcoreapp3.1/Submittable.EventProcessor.App.zip
    handler: Submittable.EventProcessor.App::Submittable.EventProcessor.App.LambdaEntryPoint::FunctionHandlerAsync
    memorySize: 1028
    timeout: 300 # 5 minutes
    reservedConcurrency: 5

  accountingApi:
    role: accountingApiRole
    timeout: 30
    package:
      artifact: Submittable.Accounting.Api/bin/Lambda/netcoreapp3.1/Submittable.Accounting.Api.zip
    handler: Submittable.Accounting.Api::Submittable.Accounting.Api.LambdaEntryPoint::FunctionHandlerAsync
    environment:
      ASPNETCORE_ENVIRONMENT: ${self:custom.aspnetCoreEnv}
      CUSTOMCONNSTR_PostgresWrite: ${self:custom.postgresWriteConnectionString}
      CUSTOMCONNSTR_PostgresRead: ${self:custom.postgresReadConnectionString}
      CUSTOMCONNSTR_Manager: ${self:custom.managerConnectionString}
      PayPal__ClientId: ${self:custom.paypalClientId}
      PayPal__ClientSecret: ${self:custom.paypalClientSecret}
      Stripe__ApiKey: ${self:custom.stripeApiKey}
      Token: ${self:custom.accountingApiToken}
      Guidestar__Apikey: ${self:custom.guidestarApiKey}
    events:
      - http:
          path: /accounting/{proxy+}
          method: any
          cors: true

  email:
    package:
      artifact: Submittable.Email.Lambda/bin/Lambda/netcoreapp3.1/Submittable.Email.Lambda.zip
    handler: Submittable.Email.Lambda::Submittable.Email.Lambda.Function::Handle
    description: Sends out an email.
    vpc: ${self:custom.vpc}
    memorySize: 1024
    timeout: 60 # 1 min
    events:
      - sqs:
          arn: !GetAtt EventQueue.Arn
          event: sendEmail
    iamRoleStatements:
      - Effect: Allow
        Action:
          - sqs:ReceiveMessage
          - sqs:DeleteMessage
          - sqs:GetQueueAttributes
        Resource: !GetAtt EventQueue.Arn
      # Allow the AWS X-Ray Daemon to relay raw trace segments data to the service's API and retrieve sampling data
      - Effect: Allow
        Action:
          - xray:PutTraceSegments
          - xray:PutTelemetryRecords
          - xray:GetSamplingRules
          - xray:GetSamplingTargets
          - xray:GetSamplingStatisticSummaries
        Resource: '*'
    environment:
      ASPNETCORE_ENVIRONMENT: ${self:custom.aspnetCoreEnv}
      CUSTOMCONNSTR_PostgresWrite: ${self:custom.postgresWriteConnectionString}
      CUSTOMCONNSTR_PostgresRead: ${self:custom.postgresReadConnectionString}
      CUSTOMCONNSTR_Manager: ${self:custom.managerConnectionString}
      Mailgun__ApiKey: ${self:custom.mailgunApiKey}
      S3__MessageAttachmentsBucket: ${self:custom.messagingAttachmentsBucketName}
      S3__FormResponseFilesBucket: ${self:custom.formResponseFilesBucketName}
      S3__TableTemplatesBucket: ${self:custom.tableTemplatesBucketName}
      Guidestar__Apikey: ${self:custom.guidestarApiKey}

  emailBulk:
    package:
      artifact: Submittable.EmailBulk.Lambda/bin/Lambda/netcoreapp3.1/Submittable.EmailBulk.Lambda.zip
    handler: Submittable.EmailBulk.Lambda::Submittable.EmailBulk.Lambda.Function::Handle
    description: Sends out bulk emails.
    vpc: ${self:custom.vpc}
    memorySize: 1024
    timeout: 600 # 10 minutes
    events:
      - sqs:
          arn: !GetAtt EventQueue.Arn
          event: sendBulkSubmissionEmails
    iamRoleStatements:
      - Effect: Allow
        Action:
          - sqs:ReceiveMessage
          - sqs:DeleteMessage
          - sqs:GetQueueAttributes
        Resource: !GetAtt EventQueue.Arn
      # Allow the AWS X-Ray Daemon to relay raw trace segments data to the service's API and retrieve sampling data
      - Effect: Allow
        Action:
          - xray:PutTraceSegments
          - xray:PutTelemetryRecords
          - xray:GetSamplingRules
          - xray:GetSamplingTargets
          - xray:GetSamplingStatisticSummaries
        Resource: '*'
    environment:
      ASPNETCORE_ENVIRONMENT: ${self:custom.aspnetCoreEnv}
      CUSTOMCONNSTR_PostgresWrite: ${self:custom.postgresWriteConnectionString}
      CUSTOMCONNSTR_PostgresRead: ${self:custom.postgresReadConnectionString}
      CUSTOMCONNSTR_Manager: ${self:custom.managerConnectionString}
      Mailgun__ApiKey: ${self:custom.mailgunApiKey}
      S3__MessageAttachmentsBucket: ${self:custom.messagingAttachmentsBucketName}
      S3__FormResponseFilesBucket: ${self:custom.formResponseFilesBucketName}
      S3__TableTemplatesBucket: ${self:custom.tableTemplatesBucketName}
      Guidestar__Apikey: ${self:custom.guidestarApiKey}

  salesforceNewSubmissionHandler:
    role: salesforceRole
    timeout: 30
    description: Handles messages from the new submission salesforce queue and sends data into salesforce
    package:
      artifact: Submittable.Salesforce.Lambda/bin/Lambda/netcoreapp3.1/Submittable.Salesforce.Lambda.zip
    handler: Submittable.Salesforce.Lambda::Submittable.Salesforce.Lambda.NewSubmissionLambdaEntryPoint::Handle
    environment:
      ASPNETCORE_ENVIRONMENT: ${self:custom.aspnetCoreEnv}
      CUSTOMCONNSTR_PostgresWrite: ${self:custom.postgresWriteConnectionString}
      CUSTOMCONNSTR_PostgresRead: ${self:custom.postgresReadConnectionString}
      CUSTOMCONNSTR_Manager: ${self:custom.managerConnectionString}
      DocumentConverter__ApiKey: ${self:custom.documentConverterApiKey}
      Mailgun__ApiKey: ${self:custom.mailgunApiKey}
      Stripe__ApiKey: ${self:custom.stripeApiKey}
      S3__MappingBucket: ${self:custom.salesforceMappingBucketName}
      S3__EditMappingBucket: ${self:custom.salesforceEditMappingBucketName}
      S3__MessageAttachmentsBucket: ${self:custom.messagingAttachmentsBucketName}
      S3__FormResponseFilesBucket: ${self:custom.formResponseFilesBucketName}
      S3__TableTemplatesBucket: ${self:custom.tableTemplatesBucketName}
      Guidestar__Apikey: ${self:custom.guidestarApiKey}
    events:
      - sqs: ${self:custom.salesforceQueueArn}

  salesforceEditSubmissionHandler:
    role: salesforceRole
    timeout: 30
    description: Handles messages from the edit submission salesforce queue and sends data into salesforce
    package:
      artifact: Submittable.Salesforce.Lambda/bin/Lambda/netcoreapp3.1/Submittable.Salesforce.Lambda.zip
    handler: Submittable.Salesforce.Lambda::Submittable.Salesforce.Lambda.EditSubmissionLambdaEntryPoint::Handle
    environment:
      ASPNETCORE_ENVIRONMENT: ${self:custom.aspnetCoreEnv}
      CUSTOMCONNSTR_PostgresWrite: ${self:custom.postgresWriteConnectionString}
      CUSTOMCONNSTR_PostgresRead: ${self:custom.postgresReadConnectionString}
      CUSTOMCONNSTR_Manager: ${self:custom.managerConnectionString}
      S3__MappingBucket: ${self:custom.salesforceMappingBucketName}
      DocumentConverter__ApiKey: ${self:custom.documentConverterApiKey}
      Mailgun__ApiKey: ${self:custom.mailgunApiKey}
      Stripe__ApiKey: ${self:custom.stripeApiKey}
      S3__EditMappingBucket: ${self:custom.salesforceEditMappingBucketName}
      S3__MessageAttachmentsBucket: ${self:custom.messagingAttachmentsBucketName}
      S3__FormResponseFilesBucket: ${self:custom.formResponseFilesBucketName}
      S3__TableTemplatesBucket: ${self:custom.tableTemplatesBucketName}
      Guidestar__Apikey: ${self:custom.guidestarApiKey}
    events:
      - sqs: ${self:custom.editSubmissionQueueArn}

resources:
  Conditions:
    EnableApiAutoScaling: !Equals ['${self:custom.enableApiAutoScaling}', true]

  Resources:
    # Enable auto scaling of the number of provisioned api lambdas.
    # See: https://aws.amazon.com/blogs/aws/new-provisioned-concurrency-for-lambda-functions/
    ApiScalableTarget:
      Type: AWS::ApplicationAutoScaling::ScalableTarget
      Condition: EnableApiAutoScaling
      Properties:
        MaxCapacity: 50
        MinCapacity: ${self:custom.apiProvisionedConcurrency}
        ResourceId: function:app-${self:custom.stage}-api:provisioned # You need to specify an alis or version here
        RoleARN: arn:aws:iam::#{AWS::AccountId}:role/aws-service-role/lambda.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_LambdaConcurrency
        ScalableDimension: lambda:function:ProvisionedConcurrency
        ServiceNamespace: lambda
      DependsOn: ApiProvConcLambdaAlias # Use the alias generated by `provisionedConcurrency` setting
    ApiTargetTrackingScalingPolicy:
      Type: AWS::ApplicationAutoScaling::ScalingPolicy
      Condition: EnableApiAutoScaling
      Properties:
        PolicyName: utilization
        PolicyType: TargetTrackingScaling
        ScalingTargetId: !Ref ApiScalableTarget
        TargetTrackingScalingPolicyConfiguration:
          # Provision for 5x bursts above average concurrency without cold starts
          TargetValue: 0.2
          PredefinedMetricSpecification:
            PredefinedMetricType: LambdaProvisionedConcurrencyUtilization

    EventQueue:
      Type: AWS::SQS::Queue
      Properties:
        VisibilityTimeout: 600
    EventQueuePolicy:
      Type: AWS::SQS::QueuePolicy
      Properties:
        PolicyDocument:
          Id: EventQueuePolicy
          Version: '2012-10-17'
          Statement:
            - Sid: Allow-SendMessage
              Effect: Allow
              Principal: '*'
              Action: sqs:SendMessage
              Resource: !GetAtt EventQueue.Arn
              Condition:
                ArnEquals:
                  aws:SourceArn: ${self:custom.eventTopicArn}
        Queues:
          - !Ref EventQueue

    SnsSubscription:
      Type: AWS::SNS::Subscription
      Properties:
        Protocol: sqs
        Endpoint: !GetAtt EventQueue.Arn
        Region: ${self:provider.region}
        TopicArn: ${self:custom.eventTopicArn}
        FilterPolicy:
          type:
            - sendEmail
            - sendBulkSubmissionEmails

    apiRole:
      Type: AWS::IAM::Role
      Properties:
        RoleName: ${self:.service}-${self:custom.stage}-apiRole
        ManagedPolicyArns:
          - 'arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole'
          - 'arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess' # Allow the AWS X-Ray Daemon to relay raw trace segments data to the service's API and retrieve sampling data
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Principal:
                Service:
                  - lambda.amazonaws.com
              Action: sts:AssumeRole
        Policies:
          - PolicyName: sls-lambda-execute-policy
            PolicyDocument:
              Version: '2012-10-17'
              Statement:
                - Effect: Allow
                  Action:
                    - cloudwatch:PutMetricData
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - logs:CreateLogGroup
                    - logs:CreateLogStream
                    - logs:PutLogEvents
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - lambda:InvokeFunction
                    - lambda:GetFunction
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - events:*
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - sns:Subscribe
                    - sns:Unsubscribe
                    - sns:ListSubscriptionsByTopic
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - sqs:SendMessage
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - s3:*
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - elastictranscoder:*
                  Resource: '*'

    accountingApiRole:
      Type: AWS::IAM::Role
      Properties:
        RoleName: ${self:.service}-${self:custom.stage}-accountingApiRole
        ManagedPolicyArns:
          - 'arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole'
          - 'arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess'
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Principal:
                Service:
                  - lambda.amazonaws.com
              Action: sts:AssumeRole
        Policies:
          - PolicyName: sls-lambda-execute-policy
            PolicyDocument:
              Version: '2012-10-17'
              Statement:
                - Effect: Allow
                  Action:
                    - lambda:InvokeFunction
                    - lambda:GetFunction
                  Resource: '*'

    salesforceRole:
      Type: AWS::IAM::Role
      Properties:
        RoleName: ${self:.service}-${self:custom.stage}-salesforceRole
        ManagedPolicyArns:
          - 'arn:aws:iam::aws:policy/service-role/AWSLambdaVPCAccessExecutionRole'
          - 'arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess'
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Principal:
                Service:
                  - lambda.amazonaws.com
              Action: sts:AssumeRole
        Policies:
          - PolicyName: sls-lambda-execute-policy
            PolicyDocument:
              Version: '2012-10-17'
              Statement:
                - Effect: Allow
                  Action:
                    - logs:CreateLogGroup
                    - logs:CreateLogStream
                    - logs:PutLogEvents
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - events:*
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - s3:*
                  Resource: '*'
                - Effect: Allow
                  Action:
                    - sqs:ReceiveMessage
                    - sqs:DeleteMessage
                    - sqs:GetQueueAttributes
                  Resource: '*'

serverless deploy output

Serverless: Learn more about configuration validation here: http://slss.io/configuration-validation
--
905 | Serverless:
906 | Serverless: Packaging service...
907 | Serverless: Installing dependencies for custom CloudFormation resources...
908 | Serverless: Installing dependencies for custom CloudFormation resources...
909 |  
910 | Type Error ---------------------------------------------
911 |  
912 | TypeError: this.awsPackagePlugin.validateStatements is not a function
913 | at ServerlessIamPerFunctionPlugin.validateStatements (/codebuild/output/src561741946/src/node_modules/serverless-iam-roles-per-function/src/lib/index.ts:62:27)
914 | at ServerlessIamPerFunctionPlugin.createRoleForFunction (/codebuild/output/src561741946/src/node_modules/serverless-iam-roles-per-function/src/lib/index.ts:209:10)
915 | at ServerlessIamPerFunctionPlugin.createRolesPerFunction (/codebuild/output/src561741946/src/node_modules/serverless-iam-roles-per-function/src/lib/index.ts:306:12)
916 | at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:510:55
917 | at tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
918 | at Object.gotValue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:168:18)
919 | at Object.gotAccum (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:155:25)
920 | at Object.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
921 | at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
922 | at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
923 | at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
924 | at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
925 | at _drainQueueStep (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
926 | at _drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
927 | at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
928 | at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
929 | at processImmediate (internal/timers.js:456:21)
930 | at process.topLevelDomainCallback (domain.js:137:15)
931 |  
932 | For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.


Installed version

Framework Core: 1.57.0
Plugin: 3.2.3
SDK: 2.2.1
Components Core: 1.1.2
Components CLI: 1.4.0

It appears to be caused by this: https://github.com/functionalone/serverless-iam-roles-per-function/issues/52

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 11
  • Comments: 17 (3 by maintainers)

Most upvoted comments

npm i serverless-iam-roles-per-function@next

worked out for me when i downgraded my serverless to 2.4

❯ sls -v
Framework Core: 2.4.0
Plugin: 4.1.0
SDK: 2.3.2
Components: 3.2.1```

Side note: Bit disappointing that we need a custom plugin to allow per function IAM roles. This is a pretty common use case and should ideally be supported by serverless.

Issue 4313 discusses this in more detail.

@blairg23 Thanks for report. Ideally this should be fixed on plugin side. Has any effort been taken in that direction?

Firstly plugin decided to depend on Framework internals, while they can change even across patch versions. It’s not safe, best if plugin is not doing that.

Secondly plugin doesn’t inform (via peerDependencies setting) with which version of a Framework it works. Note that it had last release over year ago, when Framework was at v1. Now we’re at v2, and technically everything could change in new major. I believe there should be serverless listed in peerDependencies setting to imply some version compatibility validation.

@Amir-Ahmad we’re open to have this in the Framework, and I’ve outlined a quite detailed proposal on how to refactor internals to have that issue in.

In first place we need to tackle this https://github.com/serverless/serverless/issues/8396 (PR’s welcome!)

@BatelLuzon have a nice day ^_^