constructor()

in index.js [20:45]


  constructor(serverless) {
    this.serverless = serverless;
    this.service = this.serverless.service;
    this.provider = this.serverless.getProvider('aws');

    this.hooks = {
      'before:package:setupProviderConfiguration': this.addLambdaInsights.bind(this),
    };
    if (this.checkValidationSupport(serverless)) {
      serverless.configSchemaHandler.defineFunctionProperties('aws', {
        properties: {
          lambdaInsights: {type: 'boolean'},
        },
      });

      serverless.configSchemaHandler.defineCustomProperties({
        properties: {
          lambdaInsights: {
            defaultLambdaInsights: {type: 'boolean'},
            attachPolicy: {type: 'boolean'},
            lambdaInsightsVersion: {type: 'number'},
          },
        },
      });
    }
  }