We have decided to outsource image cropping to Lambda. We’ve been using Lambda to resize images into other representations we used elsewhere whenever we would put an object in an S3 bucket. The transition was pretty easy.
- Move cropping code into its own module.
- Create a Lambda function from the module.
- Create an SNS topic.
- Subscribe to function to the topic.
- Replace original cropping and upload code with a
publishto the topic.
Doing image manipulation on somebody else’s server complicates knowing when things finish. I’ll write about that once we have a better solution.