AWS Iot lifecycle and regular topic subscription events
- [email protected]
- redis
- 
npm install --save serverless-iot-local
- 
In serverless.ymladdserverless-iot-localto plugins:
plugins:
  - serverless-iot-local- 
Start redis: 
 redis-server
- 
If you're using serverless-offline, you can run: sls offline startOtherwise run: sls iot start
CLI options are optional:
--port                -p  Port to listen on. Default: 1883
--httpPort            -h  Port for WebSocket connections. Default: 1884
--noStart             -n  Prevent Iot broker (Mosca MQTT brorker) from being started (if you already have one)
--skipCacheValidation -c  Tells the plugin to skip require cache invalidation. A script reloading tool like Nodemon might then be needed (same as serverless-offline)
The above options can be added to serverless.yml to set default configuration, e.g.:
custom:
  serverless-iot-local:
    start:
      port: 1884
    # Uncomment only if you already have an MQTT server running locally
    # noStart: true
    redis:
      host: 'localhost'
      port: 6379
      db: 12Place serverless-iot-local above serverless-offline
plugins:
  - serverless-iot-local
  - serverless-offline- Improve support of AWS Iot SQL syntax