Alex Coding
Alex Coding

Reputation: 91

How to use AWS with Next.js?

I am looking for some advices, I am using Next.js to serve static pages that can be updated frequently, my app uses all kind of rendering : SSG, SSR and iSSG (new Incremental Static Site Generation feature).

Exemple of AWS architecture I thought:

Do you know what is the best AWS architecture I could use according to my needs?

Edit: Maybe AWS Elastic Beanstalk is the solution, I am taking a look.

Upvotes: 9

Views: 4934

Answers (1)

Frank
Frank

Reputation: 710

Next.js 11 + SST + Lambda@Edge

Serverless deployment was introduced in Next.js 8. This makes it easier for you to deploy your Next.js app to AWS Lambda functions, and take advantage of the serverless architecture. It's often much cheaper to host this way, and faster because you are serving the pages behind a CloudFront CDN network.

The SST framework makes it easy to help build and deploy your Next.js app to your AWS account using a combination of S3, Lambda@Edge and CloudFront. It also helps you configure a custom domain for the endpoint.

Here's an example walking through the setup - https://serverless-stack.com/examples/how-to-create-a-nextjs-app-with-serverless.html

Upvotes: 2

Related Questions