I need to create an integration project which when executed, it should start all aws mock services such as S3, API gateway, SQS, Dynamo db and SSM. We used serverless.com framework for developing lambdas in Node.js that use the above AWS services internally. Also these lambda call another lambda using API Gateway where the X-invocation type is event for asynchronous calls.
Any suggestions on which approach should I choose for running these lambdas locally:
- Should i create a serverless project where serverless-offline plugins such as
- serverless-s3-local
- serverless-dynamo-local
- serverless-offline-ssm
- serverless-offline-dynamodb
So when this project is executed it will run these services on specific port in local machine.
Use SAM Local.
- For this i need to write a sam template as currently i have used serverless.com framework where there is serverless.yml rather than sam template.
- There is also serverless-sam plugin to export the serverless.yml to sam template, However, it throws an error for few parts in serverless.yml as for few infra build we use the output of terraform execution in serverless.yml.
- This terraform is not available for local. So basically i dont have option to use export feature of serverless-sam plugin. I would need to create a separate project that will have sam template containing specification of all dependent AWS service.
Use Python Moto library: https://github.com/spulec/moto#stand-alone-server-mode
Thanks in advance