DEV Community

loading...

Discussion on: Multi-env Next.js app with AWS Amplify & Serverless

Collapse
rwalle61 profile image
Richard Waller

Thanks for this article! I'm new to Next.js, Amplify and Serverless. I read that the aws-amplify-serverless-plugin lets you use Serverless to set up Amplify backends (medium.com/@jrheling/using-serverl...).

Do you think a serverless.yml could set up a Next.js app with the Serverless Next.js plugin, and a Amplify backend with the Serverless Amplify plugin, and they could talk to each other? What would be the difference between that and your custom solution?

Collapse
aarongarvey profile image
Aaron Garvey Author

Hey Richard, so I think the main difference between these approaches is a choice between having the amplify CI/CD tools manage the deployment of he backend and front end together, or having serverless framework deploy the backend and front end together, or in my case - having amplify CI/CD deploy the backend upon any commits pushed to my dev and master branches and then triggering the serverless framework to deploy the front end with each build.

I can’t see any reason why you couldn’t setup a serverless template as you’ve described. If you put the right pieces together you would still have your aws amplify resources deployed alongside your front end resources - it would all just be managed by the serverless deployment tools.

I think which way you chose to approach this depends on what tools your most comfortable with, and what stage your project is at. In my case, I leverage a number of tools from AWS Amplify CI/CD pipeline, and was migrating a site that was previously only static pages, and aws amplify was previously deploying everything for me. So it was easier for me to extend the amplify CI/CD build instructions to trigger a serverless front end deployment. But if you already have a NextJS deployment running on serverless framework and want to add on some aws resources at a later stage, then perhaps using the amplify serverless template is better?

Forem Open with the Forem app