antonbabenko/serverless.tf

Development environment

Opened this issue · 3 comments

cemo commented

Hi all,
we started to use many modules of serverless.tf and come up with new questions. How can we speed up development lifecycle? I mean we have lambdas, appsync, dynamodb set up but it is not clear to work on one of them on locally without deploying to AWS. Is there any recommended approach for this?

Hi @cemo !

Real deployment to AWS is the best in terms of the quality of the results you can get.

For some AWS services, there are various kinds of emulators that you can use (e.g, for sqs, dynamodb). I used them a couple of times some time ago before getting my head around and focusing on doing real AWS deployments with Terraform.

Terraform users' developer experience is what we (Betajob) are currently working on - see project modules.tf and follow @modulestf for updates.

cemo commented

Hi @antonbabenko. In terms of quality of course deploying on AWS would be best. However in order to get a test a simple go function to deploy as a lambda requires substantial amount of time when you compare with local box.
I think terraform based approaches need an orthogonal solution to test lambda + appsync or other modules on local boxes without leaving terraform environment. What I have in my mind is that using probably terraform state or source files to create necessary necessary configurations to these emulators. For example appsync module has all configurations regarding templates. We can read these files or state files to create necessary configs to pass emulators.

You can do some of it using localstack combined with Terraform AWS provider but I would not go deeper by parsing terraform state files or anything like that. In my experience, AppSync (as well as the rest of the serverless stack, actually) is hard to emulate.

Maybe someone has other opinions.