
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
serverless-offline-sns
Advanced tools
Serverless plugin to run a local SNS server and call lambdas with events notifications.
A serverless plugin to listen to offline SNS and call lambda fns with events.
To use this plugin you will need an SNS endpoint. You can use your AWS account for SNS or you can use the built in SNS offline server -
serverless offline-sns serve
Install the plugin
npm install serverless-offline-sns --save
Let serverless know about the plugin
plugins:
- serverless-offline-sns
Configure the plugin with your offline SNS endpoint and a free port the plugin can use.
custom:
offline-sns:
port: 4002 # port for the sns server to run on
serve: true # should start an offline SNS server? only need one of these
debug: false
sns-endpoint: http://localhost:4567 # optional if you want to point at a different SNS endpoint
Configure your function handlers with events as described in the Serverless SNS Documentation
Here's an example serverless.yml
config which calls a function on an SNS notifcation. Note that the offline-sns plugin will automatically pick up this config, subscribe to the topic and call the handler on an SNS notification.
functions:
pong:
handler: dist/services/hello/index.pong
events:
- sns: test-topic
Or you can use the exact ARN of the topic:
functions:
pong:
handler: dist/services/hello/index.pong
events:
- sns:
arn: "arn:aws:sns:us-east-1:123456789012:test-topic"
Here's a demo of some code that will trigger this handler:
import AWS = require("aws-sdk");
const sns = new AWS.SNS({
endpoint: "http://localhost:4002",
region: "us-east-1",
});
sns.publish({
Message: "hello!",
MessageStructure: "json",
TopicArn: "arn:aws:sns:us-east-1:123456789012:test-topic",
});
If you use serverless-offline this plugin will start automatically.
However if you don't use serverless-offline you can start this plugin manually with -
serverless offline-sns start
FAQs
Serverless plugin to run a local SNS server and call lambdas with events notifications.
The npm package serverless-offline-sns receives a total of 11,911 weekly downloads. As such, serverless-offline-sns popularity was classified as popular.
We found that serverless-offline-sns demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.