How to automatically resize images with serverless

Link to chapter — https://serverless-stack.com/examples/how-to-automatically-resize-images-with-serverless.html

Nice! Works, but I have a doubt.

Is it possible to use the created buckets with CloudFront? I tried but the return is Access Denied. Any suggestion? Thanks!

You mean attaching a CloudFront distribution to the S3 bucket?

With public access, the bucket’s objects are visible with my assigned cloudfront URL, but I would like to keep the private acces in objects, and load the files with cloudfront URL.

Hey @gregdalzotto, I don’t think the bucket need public access in order to attach it to a CF distribution. We actually have a similar setup for our StaticSite construct - StaticSite | Serverless Stack (SST)

The bucket is created here - serverless-stack/StaticSite.ts at master · serverless-stack/serverless-stack · GitHub

And it is attached to a distribution here - serverless-stack/StaticSite.ts at master · serverless-stack/serverless-stack · GitHub

Let me know if that makes sense.