I am pretty new to AWS and trying to creating AWS lambda application using node js and serverless framework. But I stumbled upon a point where I have to run the things locally to test the things like dynamo db , SNS, S3 etc. What is the proper way to do the things in local. If there is any article or tutorial like github links which could help me with situation, Please share it
What is the correct way to do the development with aws serverless framework with other AWS services in local.
2
Answers
Yes, this the use case of localstack , you can test your developpement locally :
Hoping this help.
I appreciate 👏 @Med Agou’s answer and he is right, Localstack can help you in some use cases. On the other hand, not all services can be run locally and you may stack at some point.
I would recommend running your dev tests on the real AWS account like a sandbox. In the initial stage, it requires extra efforts in IaC but the testing process will be more stable and you will not need to maintain infra in two places.
A good solution is:
Write terraform definitions for infra, so you can easily (re-)deploy the environment and copy it immediately if you need one more (DEV, TEST, PERF, PROD, whatever…)
Prepare CI/CD for your lambda function(-s) so you can update the function automatically. There are many options to deploy Lambda function code:
🚀 One more benefit of this solution is that you test functions in a real environment and reduce potential misconfigurations.