skip to Main Content

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


  1. Yes, this the use case of localstack , you can test your developpement locally :

    Hoping this help.

    Login or Signup to reply.
  2. 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:

    1. 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…)

    2. Prepare CI/CD for your lambda function(-s) so you can update the function automatically. There are many options to deploy Lambda function code:

    • 2.1. zip file -> Lambda function
    • 2.2. zip file -> S3 bucket -> Lambda function (better versioning)
    • 2.3. Docker image -> ECR -> Lambda function (More efforts in the beginning but better option for cold start)

    🚀 One more benefit of this solution is that you test functions in a real environment and reduce potential misconfigurations.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search