1

I am showing user profile picture from private s3 bucket in mail. The image is properly visible for a certain time period. After some time the image is not showing because s3 private image url link is expired. So how to make profile image link always accessible from private s3 bucket whenever I open mail?.

Maurice
  • 11,482
  • 2
  • 25
  • 45
Ashish Rai
  • 11
  • 3

1 Answers1

2

That's not possible using pre-signed URLs. Once the URL expires because the expiration time is reached or the credentials used to create the URL expire, it is useless.

If your bucket needs to stay private, you could put a CloudFront distribution in front of it and configure Origin Access Identity so only CloudFront can use the bucket and then refer to the CloudFront URL in your E-Mail. This means the content of the bucket will be publicly accessible.

Another option is to make the bucket publicly readable, which is not desirable.

The third option would be to embed the image in the E-Mail, so the client doesn't have to download anything from S3. This increases the size of your E-Mail, though. See this question for some hints on how to do that.

Maurice
  • 11,482
  • 2
  • 25
  • 45