Johhan Santana
Johhan Santana

Reputation: 2415

How to whitelist your website to be able to view files from AWS S3 bucket?

I'm trying to get a static website hosted in AWS S3 to be the only way to download/view files from another S3 bucket.

Is this possible?

I've implemented a solution with a custom nodejs backend to do the validation and send the file to the front-end but I think this would be more expensive in the long run.

Upvotes: 0

Views: 626

Answers (1)

Greg Bulmash
Greg Bulmash

Reputation: 1947

You can use the AWS SDK for Node to create a S3 pre-signed URL that makes the item available at that link temporarily... few seconds, few minutes. Every time you do it, you get a new unique URL that expires.

APIDoc: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getSignedUrl-property

Upvotes: 1

Related Questions