To Nha Notes | Dec. 23, 2024, 10:27 p.m.
Projects using Prisma Client can be deployed to many different cloud platforms. Given the variety of cloud platforms and different names, it's noteworthy to mention the different deployment paradigms, as they affect the way you deploy an application using Prisma Client.
AWS Lambda Web Adapter allows developers to build web apps (http api) with familiar frameworks (e.g. Express.js, Next.js, Flask, SpringBoot, ASP.NET and Laravel, anything speaks HTTP 1.1/1.0) and run it on AWS Lambda. The same docker image can run on AWS Lambda, Amazon EC2, AWS Fargate, and local computers.
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
serverless app to deploy next app to aws lambda
Globals:
Function:
Timeout: 30
Resources:
NextAppStackFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: app/
PackageType: Image
Architectures:
- x86_64
Events:
HttpEvent:
Type: HttpApi
Metadata:
DockerTag: v1
DockerContext: ./app
Dockerfile: Dockerfile
Outputs:
NextAppStackUrl:
Description: "API Gateway endpoint URL for servering the next app"
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/"
Either CDK or SAM create a demo environment showing how you can use Amazon API Gateway, AWS Lambda, Amazon CloudFront, and Amazon S3 to run a Next.js application.

https://www.prisma.io/docs/orm/prisma-client/deployment/deploy-prisma
https://dev.to/taranjeetsingh/deploy-next-js-app-to-aws-lambda-using-aws-sam-5ael
https://github.com/singh-taranjeet/next-aws-lambda
https://github.com/aws-samples/aws-lambda-nextjs
https://github.com/aws-samples/aws-lambda-nextjs/tree/main/nextjs-lambda-sam
https://github.com/awslabs/aws-lambda-web-adapter/tree/main/examples
https://www.freecodecamp.org/news/deployment-strategies-for-nextjs-apps/
https://docs.aws.amazon.com/amplify/latest/userguide/deploy-nextjs-app.html
https://medium.com/@redrobotdev/next-js-deployment-using-ecs-with-fargate-1a730a8d0cb1
https://redrobot.dev/learn/articles/nextjs-containerization#containerizing-a-nextjs-application