When Serverless WarmUp Plugin invoke my lambda , than my lambda gives error when i manually invoke it workes fine

Viewed 266

**serverless. yml **.

 service: LambdaColdStartRnD
configValidationMode: error

provider:
  name: aws
  runtime: nodejs14.x
  memorySize: 512
  timeout: 30
  stage: development
  region: ap-south-1
  lambdaHashingVersion: 20201221
  iamRoleStatements:
    - Effect: 'Allow'
      Action:
        - 'lambda:InvokeFunction'
      Resource: '*'

plugins:
    - serverless-webpack
    - serverless-plugin-warmup

functions:
  api:
    handler: lambda.handler
    events:
      - http: ANY /
      - http: 'ANY /{proxy+}'

package:
  individually: true
  patterns:
    - '!node_modules/**'

custom:
  warmup:
    RNDwarmer:
      enabled: true
      role: IamRoleLambdaExecution
      events:
        - schedule: 'cron(0/2 * ? * * *)' 
      concurrency: 5
      prewarm: true
  webpack:
    webpackConfig: 'webpack.config.js' # Name of webpack configuration file
    includeModules: false # Node modules configuration for packaging
    packager: 'npm' # Packager that will be used to package your external modules
    excludeFiles: src/**/*.test.js # Provide a glob for files to ignore. 

I have defined a custom warmup which creates 5 containers and it is itializing the function with 5 conatiners but cant invoke function below is screenshot of xray traces and logs. x ray trace.

0 Answers
Related