'NextJS deployed to AWS Amplify with ISR - build takes too long

By default, while deploying the NextJS app to AWS Amplify, it uses 7GB RAM. When I build my app on EC2 instance with 2GB RAM (1vCPU), building app takes less than a minute, whereas, when the app builds on AWS Amplify, it takes a few minutes. Is there a way to analyze why this happens and reduce the time AWS Amplify takes to build?

By build time, I am not including the time for provisioning or other tasks. I am talking about build time only.



Solution 1:[1]

The issue is building the SSR Edge Lambdas takes a long time, especially for them to provision.

Amplify people have acknowledged this and are fixing but no ETA yet sadly.

https://github.com/aws-amplify/amplify-console/issues/2127

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mike F