serverless-plugin-aws-alerts icon indicating copy to clipboard operation
serverless-plugin-aws-alerts copied to clipboard

Support for Serverless v2

Open d-fay opened this issue 4 years ago • 3 comments

This is a Feature Proposal

Description

NPM warns of possible compatibility issue with Serverless v2

Everything appears to work with sls-v2. Packaging just needs updating. Alerts are still being created during deployment.

When running npm audit fix we see the following warning:

npm WARN [email protected] requires a peer of serverless@^1.12.0 but none is installed. You must install peer dependencies yourself.

Additional Data

  • Serverless Framework Version: [email protected]
  • Stack Trace: N/A
  • Provider Error messages: when running npm audit fix...
npm WARN [email protected] requires a peer of serverless@^1.12.0 but none is installed. You must install peer dependencies yourself.

Alerts continue to be correctly created in AWS, but NPM doesn't expect the plugin to work.

d-fay avatar Jul 08 '21 16:07 d-fay

@d-fay Latest version (v1.7.3) is configured to list servelress at v2:

https://github.com/ACloudGuru/serverless-plugin-aws-alerts/blob/v1.7.3/package.json#L42

Please upgrade

medikoo avatar Jul 16 '21 15:07 medikoo

I've done npm i serverless-plugin-aws-alerts serverless-mysql serverless

...
+ [email protected]
+ [email protected]
+ [email protected]
added 630 packages from 391 contributors, updated 3 packages and audited 652 packages in 118.474s
...

yet still

$ sls deploy --aws-profile serverless-dev-extravision --stage live
 
  Type Error ---------------------------------------------
 
  TypeError: Cannot read property 'defineFunctionProperties' of undefined
      at new AlertsPlugin (/home/falken/workspace/serverless/bt-serverless-quiz/node_modules/serverless-plugin-aws-alerts/src/index.js:13:36)
      at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:84:28)
      at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:121:31
      at Array.forEach (<anonymous>)
      at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:121:8)
      at /usr/local/lib/node_modules/serverless/lib/Serverless.js:98:35

serverless.yml :

custom:
  alerts:
    stages:
      - live
    topics:
      alarm:
        topic: ${self:service}-${opt:stage}-alerts-alarm
        notifications:
          - protocol: email
            endpoint: [email protected]
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.22.7
     Framework Version:         1.77.1
     Plugin Version:            3.6.18
     SDK Version:               2.3.1
     Components Version:        2.33.0

tomchiverton avatar Nov 02 '21 10:11 tomchiverton

Setting in package.json the plugin version to "1.6.1" fixes it

tomchiverton avatar Nov 02 '21 11:11 tomchiverton