Serverless-offline: Offline SNS to invoke lambda

Created on 13 Apr 2017  路  6Comments  路  Source: dherault/serverless-offline

Is it possible to add the support of lambda invocation by a sns message in offline mode ?

question

Most helpful comment

Hi,

I would like to run my AWS application on the developer's computer in offline mode. Today I can do it with the great dynamoDB offline plugin. I wish the same thing for the lambda invocation by SNS and the S3 bucket access.
How to do that .. ? I don't know. But I imagine a dummy local SNS service which doesn't send the message to the AWS service but calls the lambdas having the sns topic as trigger. The perfect solution should an async call.

Seb

All 6 comments

Hi @schassande , how would you do that ?

Hi,

I would like to run my AWS application on the developer's computer in offline mode. Today I can do it with the great dynamoDB offline plugin. I wish the same thing for the lambda invocation by SNS and the S3 bucket access.
How to do that .. ? I don't know. But I imagine a dummy local SNS service which doesn't send the message to the AWS service but calls the lambdas having the sns topic as trigger. The perfect solution should an async call.

Seb

I'm wondering about the same thing for proxying requests from Amazon Lex Lambda handlers to a local server. I want the benefit to quickly change the lambda handler code during development more than I care about offline capability...

Maybe we could deploy a lambda function to the service endpoint which proxies invocations through to the laptop server ...?

Would such an implementation fit into serverless-offline?

I'm wondering the same thing. Our current project is using the serverless-webpack plugin and I'm having success invoking it with sls webpack invoke, passing the function name and the invocation event as parms. I even have it working in VS Code so you get breakpoint stepping which is super nice.

It would be great to see an example of this working with serverless-offline. (My big disconnect is that I'm using an event trigger and not an API Gateway call and AFAIK that's not supported in serverless offline (??)).

I've also had success doing this with the npm module lambda-local if you aren't doing anything fancy with webpack.

The serverless-offline-sns plugin doesn't support all of the runtimes supported by the base serverless-offline plugin. It only supports node as a runtime right now. That plugin simply exposes HTTP endpoints to invoke the functions and handles the subscription and setup of SNS topics automatically on a local SNS-compatible interface. Would propose that this functionality should live in serverless-offline to support the SNS event trigger. Could likely be expanded to support SQS and others too. Any chance we can iterate on a design for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  4Comments

JimLynchCodes picture JimLynchCodes  路  4Comments

MEGApixel23 picture MEGApixel23  路  4Comments

dnalborczyk picture dnalborczyk  路  3Comments

Looveh picture Looveh  路  4Comments