Use S3 Object Lambda with Amazon CloudFront to tailor content for end users

Using Amazon S3 Object Lambda, you can add your own code to S3 GET, HEAD, and LIST API requests to modify data as it is returned to an application. You can now use an S3 Object Lambda Access Point alias as an origin for your Amazon CloudFront distribution to tailor or customize data to end users. For example, you can resize an image depending on the device that an end user is visiting from.

Source:: Amazon AWS