https://github.com/tradle/serverless-iot-local
https://github.com/tradle/serverless-iot-local
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/tradle/serverless-iot-local
- Owner: tradle
- License: mit
- Created: 2017-12-11T15:03:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-14T01:17:49.000Z (about 1 year ago)
- Last Synced: 2025-04-14T02:26:02.756Z (about 1 year ago)
- Language: JavaScript
- Size: 309 KB
- Stars: 14
- Watchers: 4
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# serverless-iot-local
AWS Iot lifecycle and regular topic subscription events
## Prerequisites
* serverless@1.x
* redis
## Install
1) `npm install --save serverless-iot-local`
2) In `serverless.yml` add `serverless-iot-local` to plugins:
```yaml
plugins:
- serverless-iot-local
```
## Usage
1. Start redis:
`redis-server`
2. If you're using [serverless-offline](https://github.com/dherault/serverless-offline), you can run:
`sls offline start`
Otherwise 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.:
```yml
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: 12
```
### Using with serverless-offline plugin
Place `serverless-iot-local` above `serverless-offline`
```yaml
plugins:
- serverless-iot-local
- serverless-offline
```
## Todo
- Improve support of AWS Iot SQL syntax
## License
[MIT](LICENSE)