Get Presigned URL for image update using AWS s3 console approach

0

Hi, we tried with the link with the option using the s3 console

We are able to get the Presigned URL but this URL is not working to upload/update the image and unable to access the image from public Net for specified duration.

FYI:

  1. We are not using any KMS for encryption
  2. Inspite of generating Presigned URL for below image unable to view from Public Net https://sdfwq.s3.ap-south-1.amazonaws.com/muslim1.jpg

Pls suggest the way forward

Thanks vijay

2 Answers
0

Making sure I'm answering the correct question here:

You want to create a presigned URL so that you can upload an object to S3. The page you've linked to is for downloading an object (although the operations are very similar).

Note that you can't use a presigned URL for one action (say, download - a GET action) and use it to upload (a PUT or POST action). Presigned URLs are specifically for one action and one object only - in a specific bucket.

When you sign the URL it will contain a set of parameters: The bucket name; the action; the object name; and optional other parameters such as the content type. It's mandatory that the call that you make to S3 using the presigned URL have exactly those parameters and none different otherwise it won't work.

In order to troubleshoot this specific question further, you'd need to supply the action you're trying to take and the error message. Don't paste the presigned URL into this forum as it is public - you don't want anyone misusing it.

profile pictureAWS
EXPERT
answered 6 months ago
0

There are two things to note. One is that now S3 objects have the block public access setting on by default. You will need to uncheck block public access and apply a bucket policy to the bucket to allow public access. - https://repost.aws/knowledge-center/read-access-objects-s3-bucket

The second thing to note is that the presigned URL has the same exact permissions as the role that generated it. A quirk is you can actually create a URL for an object you do not have access to and subsequently the URL will not provide access even though you can create it. Ensure the role that is used to generate the URL has access and is from an account that owns the bucket. I have included some other links below.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/troubleshoot-403-errors.html

AWS
answered 6 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.

Guidelines for Answering Questions