Post processing files uploaded to S3
- Resize & compress images uploaded to AWS S3
- Delete thumbnails when the original image is deleted
We use The Serverless Framework to develop and deploy our AWS Lambda functions.
See their docs for more details.
Serverless App will be deployed automatically by GitHub Actions.
To migrate legacy images that unprocessed by the current version of Lambda function, please run:
npm run migrate:images
From Configuring Amazon S3 event notifications:
If your notification ends up writing to the bucket that triggers the notification, this could cause an execution loop. For example, if the bucket triggers a Lambda function each time an object is uploaded, and the function uploads an object to the bucket, then the function indirectly triggers itself. To avoid this, use two buckets, or configure the trigger to only apply to a prefix used for incoming objects.
If you are facing the following error, try to delete enabled S3 events first.
An error occurred: *****CustomS31 - Failed to create resource. Unable to validate the following destination configurations