Massive performance improvements:
- Added Memory recommendation, ensuring 1 full vCPU provisioning
- Removed
aws-sdk
dependency and replaced it withaws-sdk-js-v3
modules for signinf and s3, idea credit Mykhailo Matviiv. 6MB total package, 1200ms cold, 400ms hot. - Changed the email sending method to a non-blocking call since the reply isn't used in any way other then logging, idea credit Mykhailo Matviiv and Lambda non-blocking tips from sensedeep. 6MB total package, 1200ms cold, 400ms hot.
- Fully removed the
import
of AWS SDK, addedtype: module
to package.json to rely on AWS Lambda's built-in shipped AWS SDK V3. 2.25MB total package, 1000ms cold, 350ms hot. - Added webpack build step to further reduce the package size, tree-shake it and minmize. 78KB total package, 750ms cold, 200ms hot.
- Replaced Axios with
https
andurl
, webpack with esbuild. 32KB total package, 720ms cold, 180ms hot.