![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
serverless-leo
Advanced tools
Readme
Serverless plugin. Deploy your leo bots and microservices using serverless.
If you don't have serverless framework globally installed
npm install serverless -g
Copy the migrateToServerless.js file into your existing microservice directory.
node migrateToServerless.js
See additional notes within the migrateToServerless.js script.
serverless create --template-url https://github.com/LeoPlatform/serverless-leo/tree/master/templates/microservice -p my-microservice
cd my-microservice
npm install
serverless create bot --name my-bot-name
npm install serverless-leo --save-dev
plugins:
- serverless-leo # Enable serverless-leo plugin
custom:
leoStack: TestBus # Configure serverless-leo
functions:
hello:
handler: index.handler
events:
- leo: helloWorldTestQueue # Trigger Lambda from a Leo Queue
world:
handler: index.handler
events:
- leo:
cron: 0 0 1 * * * # Trigger Lambda from a Leo Cron (down to minute)
Use the standard serverless deploy
cli command to deploy your microservice. Optional -s or -stage parameter (standard serverless).
Requires the leo platform (bus). Step 2 in this guide: https://github.com/LeoPlatform/Leo#install-the-leo-platform-stack
Create a "bot" that will run when events are added to a queue. The events will be handled in order and only one lambda will handle events at a time.
hello:
handler: index.handler
events:
- leo: helloWorldTestQueue
You can specify multiple queues for a single lambda. Each will become a separate bot, visible in the bus ui (Botmon).
You can define the queue as an object and give the bot a name. Otherwise the name of the bot will be the name of the lambda plus the queue.
hello:
handler: index.handler
events:
- leo:
queue: helloWorldTestQueue
name: helloBot
Create a "bot" that will run on a cron schedule. Only one lambda will run at any given time for a single bot.
world:
handler: index.handler
events:
- leo:
cron: 0 0 1 * * *
The bot will be named the same as the lambda.
Create multiple bots using the same lambda by adding "botCount". This will create the number of bots specified and pass in "botNumber" into the event when the bot is ran.
world:
handler: index.handler
events:
- leo:
queue: helloWorldTestQueue
botCount: 4
This allows you to partition the queue, or change the configuration of the bot based on the value of the variable at run time.
Create bots without a trigger by adding "register: true".
world:
handler: index.handler
events:
- leo:
register: true
You can configure the plugin to use different stacks for different stages.
custom:
dev:
leoStack: TestBus
test:
# The arn for the LeoInstallFunction lambda in your leo platform stack.
# This is an alternative to using the leoStack variable. EG: the bus and lambda are in different accounts.
leoRegister: arn:aws:lambda:us-east-1:123456:function:TestBus-LeoInstallFunction-2IMP25UOQ64G
In this example leoStack would be used when deployed using --stage dev. leoRegister would be used when using --stage test
You can invoke a bot to run on your local machine as if it were running in the cloud. It will respect the checkpoint and update it as it progresses.
serverless invoke-bot -s test -f your_function_name
FAQs
Serverless plugin for leo microservices
The npm package serverless-leo receives a total of 417 weekly downloads. As such, serverless-leo popularity was classified as not popular.
We found that serverless-leo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.