How to develop serverless as a team with AWS AppSync?
Asked Answered
S

4

4

I have a general question about developing serverless applications and AWS AppSync in particular. We're thinking about going serverless for a small project and I'm wondering how people generally set up their development environment when creating a "serverless" application.

I've seen that the serverless framework provides some capabilities to run lambda's locally, but as far as I can see, the available appsync-plugin does not provide full "offline"-functionality for AppSync.

I'm curious to know how other teams do serverless development? Does everybody have their own AWS-side setup? Just a general development-instance of everything? I'm grateful for any opinion and input!

Songwriter answered 28/5, 2018 at 6:10 Comment(0)
N
1

This may have been updated since this was asked but serverless-appsync-plugin now states:

You can use serverless-appsync-offline to autostart an AppSync Emulator which depends on Serverless-AppSync-Plugin with DynamoDB and Lambda resolver support

Which I believe is what you are looking for.

Nietzsche answered 31/10, 2018 at 17:7 Comment(1)
I was trying to use this approach but in the documentation it only shows examples to connect to DynamoDB resolvers. Could you make it work with Lambda resolvers?Paigepaik
M
2

In our setup, everyone can have get their own personal serverless stage for developing their API. I'm interested in trying to run development offline but didn't get to that yet.

When we push to master, our CodePipeline will start building to our integration test stage. By default, our services (our app is split to many subdomains) are configured to use the integration test API. That API should be relatively stable for development. We can switch to the personal API when developing API.

We use common DynamoDB tables, streams and Elasticsearch instances for all development stages. DynamoDB tables and indexes are deployed with serverless in development side and in production side they are maintained manually.

Our production and beta stages are in a separate AWS account.

Mlle answered 5/6, 2018 at 21:11 Comment(3)
We do something similar, except that we create the full stack (including DynamoTables) for each build, and have scripts to allow the developers to create and remove a full stack using Serverless. This way everyone gets a completely isolated environment and it uses all the same scripts we would use to set up production.Concertgoer
@FrancisUpton I have previously built a dev environment (not with serverless) with a build script that builds everything. There are benefits for being able to develop in an isolated environment. The biggest drawback (with my simple scripts) was the time it took to build, install and populate everything to keep updated. Our serverless setup feels a bit more scalable in this regard. I can clone just the repo of the service that I'm currently working with and run its development server and otherwise use the services that are running in the integration test.Mlle
yes, our build is about 4 minutes which fully deploys the serverless stack; the best thing about this is much of the devops work is now done and part of this script (of course there is monitoring and such associated with production, but one can even imagine this setup being extended to support that).Concertgoer
N
1

This may have been updated since this was asked but serverless-appsync-plugin now states:

You can use serverless-appsync-offline to autostart an AppSync Emulator which depends on Serverless-AppSync-Plugin with DynamoDB and Lambda resolver support

Which I believe is what you are looking for.

Nietzsche answered 31/10, 2018 at 17:7 Comment(1)
I was trying to use this approach but in the documentation it only shows examples to connect to DynamoDB resolvers. Could you make it work with Lambda resolvers?Paigepaik
L
1

Joining late but here is what you are looking for:

https://github.com/bboure/serverless-appsync-simulator

It offers full support for dynamodb, http, elasticsearch and Lambda resovlers.

serverless-appsync-offline should be considered deprecated as it is not maintanined anymore and it relies on an archived repo as well

Lanciform answered 19/12, 2020 at 18:14 Comment(1)
This should be a right answer!Quackenbush
S
0

Serverless is one way to do it. SAM Local is also another option, with the SAM CLI. I've used it with some success although it wasn't quite as straightforward as I would have liked. Seems like the development environments are a bit new for serverless.

Serpent answered 28/5, 2018 at 6:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.