I am evaluating serverless v AWS SAM CLI. I am trying to understand how can i facilitate a local dev workflow when developing using the following:-
I can see from the doc that serverless has local options for:-
Not obvious if there is a solution for:-
I can see from the SAM doc that its possible to test python Lambdas against local DynamoDB. Not clear what else is possible or if you have to point it to a an actual AWS instance for the rest (S3, SQS etc)
Any pointers?
AWS SNS is a publisher subscriber network, where subscribers can subscribe to topics and will receive messages whenever a publisher publishes to that topic. AWS SQS is a queue service, which stores messages in a queue.
SQS provides queues for your serverless applications. You can use a queue to send, store, and receive messages between different services in your workload.
SNS works with Serverless in three ways. First, you can configure an SNS event in your Serverless function. This uses the integration between AWS Lambda and SNS and runs your Serverless function for each message (or group of messages) that is sent to the SNS topic.
Having SQS in between SNS and Lambda allows reprocessing older unprocessed events in case Lambda fails to process. SQS allows to put a delay, so that message gets processed after some time, it may be useful in the scenario where data takes time to be available.
I would look into leveraging something like https://github.com/localstack/localstack to achive SQS and SNS.
For APIGW endpoint this is built into sam-cli in your SAM template using the Events param on your function resource or using API resources. See API section in following link https://docs.aws.amazon.com/lambda/latest/dg/serverless_app.html
Although it does not have complete functionality yet so it might not have everything you need like request body validation for example. I usually find I can do most of my app testing locally with this before deploying and doing more integration testing in real env.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With