Reputation: 1058
I have an ec2 instance running a flask website, and I want to get a certain image from s3 only if a certain user is logged into the site and display it on the homepage. The image can be downloaded with cli tools on the ec2 instance, but I don't want to save it to the harddrive. I want to keep the direct link to the object in s3 private.
Basically, can I do something like what this user is doing, but instead pass the file into the template and display it?
Upvotes: 1
Views: 1085
Reputation: 5625
CloudFront signed cookies can be used to serve private content. It is possible to prevent misuse of cookies by:
Don't forget to create an Origin Access Identity (OAI) to give necessary permissions to Cloudfront to access the bucket.
Upvotes: 1