Appendix A: Backward Compatibility - Serverless Image Handler

Appendix A: Backward Compatibility

The updated Serverless Image Handler solution is compatible with legacy image request formats, including the Thumbor and Custom (with rewrite function) formats from previous versions of this solution. If you are using a previous version of this solution and have image requests formatted for use with that version, review the following notes to ensure minimal breaking changes or parities.


Legacy requests (Thumbor and Custom) are currently limited to: sourcing images from the root level of Amazon S3 buckets (sourcing images from a subfolder within an Amazon S3 bucket will result in an error) and sourcing original images from the first bucket only in the SOURCE_BUCKETS environment variable. You can adjust this in the environment variables section of your image handler AWS Lambda function. For example:

SOURCE_BUCKETS: “my-bucket-001, my-bucket-002, my-bucket-003”


Thumbor image requests can be specified as normal, with filters and other relevant properties added on as suffixes to the default CloudFront ApiEndpoint. For example:



Custom image requests that used the previous solution versions rewrite feature can also be specified as normal. Note that the REWRITE_MATCH_PATTERN and REWRITE_SUBSTITUTION environment variables for your image handler function must be updated with the appropriate (JavaScript/ECMAScript-compatible) regular expressions and strings.