Comments (8)
What would work is an SNS subscription function that takes a list of SNS subscriptions during deploy, and then just sets them up.
Something like this, but iterating over an array of objects:
module.exports.registerSNS(freq) {
Lambda.getFunctionConfiguration({ FunctionName: thisLambdaFunctionName },
function (err, data) {
if (err) return console.log(err);
var params = {
Protocol: 'lambda',
TopicArn: freq,
Endpoint: data.FunctionArn
};
sns.subscribe(params, function (err, data) {
if (err) return console.log(err, err.stack); // an error occurred
if (!data.SubscriptionArn) {
var confirm_params = {
Token: 'STRING_VALUE', /* required */
TopicArn: freq,
AuthenticateOnUnsubscribe: 'STRING_VALUE'
};
sns.confirmSubscription(confirm_params, function (err, data) {
if (err) return console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
} else console.log('Note: Already subscribed to ' + data.SubscriptionArn);
});
});
}
Where would I specify the SNS subscriptions? In lambda.json
? Or does it need a separate wiring.json
file?
I'll probably extend it with other things as well, like registering workflow types, etc...
from serverless.
Pre- and post- deployment hooks in jaws deploy
would allow easy prototyping and extensibility.
from serverless.
Pretty sure this will be fixed in the v1.0.0 branch. Current deploy deletes then re-creates lambda which is causing SNS breakage. New code will do update and preserve. I like the idea of hooks.
from serverless.
Cool. We also need a mechanism to create them initially (and to function as documentation of the app's structure).
from serverless.
I don't think hooking up SNS to invoke lambda is in the scope of JAWS. Just my opinion though.
from serverless.
I do like the idea of the pre/post deploy hooks. I'm going to think about that. Maybe those are just functions you can specify in the JSON file located in the lambda's folder. Super simple.
from serverless.
This request is fulfilled by #214 - thanks to @dekz
from serverless.
Event support is in v0.4
from serverless.
Related Issues (20)
- Serverless4: Using esbuild's "packages: external" flag doesn't seem to work HOT 3
- Serverless4: Unable to Ensure that the Prisma libquery Engine and schema.prisma are Included in my Bundle HOT 7
- Support MFA Prompt when using an AWS Profile
- V4 progress spinner conflicts with plugins HOT 1
- Error: Cannot find module 'serverless/lib/serverless-error' While installing the appsync plugin HOT 2
- Dev Mode instruments all functions across multiple services if run in parent folder
- Ensure Bref works with Serverless Framework V.4 HOT 1
- Ensure Lift works with Serverless Framework V.4 HOT 7
- v3: Error: Cannot use 'publicReadAccess' property on a bucket without allowing bucket-level public access through 'blockPublicAceess' property. HOT 2
- Resolvers error regarding `replace`
- Serverless V4 deployment Error HOT 2
- Serverless command "offline" not found HOT 1
- Unable to set `maximumConcurrency` on `events.sqs` HOT 1
- Dev Mode does not close on the first CTRL+C
- Dev Mode occassionally misses prefixed and colored hyphen
- Documentation is not updated about the v3 HOT 1
- Encountering "Internal Serverless Error" in commands HOT 3
- Menu Overlap Issue in Documentation HOT 2
- Custom resource deployment hangs forever HOT 4
- Show helpful errors when the build type (e.g. `esbuild`) is missing in the `build` section
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless.