Skip to content

How to Access Private S3 Bucket Images from Amplify Frontend-Only App Without Backend?

0

I have an AWS Amplify frontend-only app (no backend, no Cognito authentication) and an S3 bucket with images set to private (no public access). I want to fetch and display these private images securely in my Amplify app without making the bucket public.

Is there a way to access private S3 images directly from a frontend-only Amplify app without adding backend code or authentication services like Cognito? If not, what is the recommended approach to securely serve private S3 images in such a scenario?

asked a year ago140 views

2 Answers
5

I believe the answer is NO, you cannot directly access private S3 images from a frontend-only Amplify app without some form of backend or authentication, instead considering using a Backend to Generate Presigned or CloudFront with Signed URLs.

EXPERT

answered a year ago

0

Hey,

Hope you're keeping well.

You can’t directly access a private S3 object from a purely frontend app without some way to sign the request, because S3 requires authenticated access for private buckets. The usual secure approach is to introduce a lightweight backend (could be AWS Lambda or API Gateway) that generates pre-signed URLs using the AWS SDK, which your frontend can then use to fetch the file. If you want CDN performance and control, you can front the bucket with CloudFront and use signed URLs or signed cookies to restrict access. Without Cognito or backend logic, there’s no secure method to expose private S3 objects directly to a browser.

Thanks and regards,
Taz

answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.