Amplify + Nextjs 12: CloudFront error 503 on API routes

0

I've deployed a Nextjs v12 app on Amplify but I got error 503 on nextjs API routes:

ISSUE The Lambda function associated with the Cloudfront distribution is invalid or doesn't have the required permissions. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through Cloudfront, you can find steps to troubleshoot and help prevent this error by reviewing the Cloudfront documentation.

MY TRIES I tried to add permissions for lambda functions to the Amplify role but it doesn't work. Also can't find a policy specific to lambda@edge. I can see on the linked Cloufront the lambda@edge. I found different documentation on this issue but the only solution proposed was to downgrade Nextjs to v11, something I wan to avoid. No issues logged in the Amplify deploy: 2023-03-21T18:42:58 [INFO]: Deployed the following resources to your account: 2023-03-21T18:42:58 [INFO]: - CloudFront Domain ID: xxx 2023-03-21T18:42:58 [INFO]: - SSR Lambda@Edge: xxx 2023-03-21T18:42:58 [INFO]: - API Lambda@Edge: xxx 2023-03-21T18:42:58 [INFO]: - Image Optimization Lambda@Edge: xxx 2023-03-21T18:42:58 [INFO]: - S3 Bucket: xxx 2023-03-21T18:42:59 [INFO]: Deployment complete

SPECS I'm using Amplify 'web dynamic', Nextjs v12, prisma (I do 'npx prisma generate' in the build phase).

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠