Skip to content

Format of S3 pre-signed URLs

I’m trying to create an S3 pre-signed URL in my JavaScript code using:

var params = {Bucket: 'myBucketName', Key: 'key', Expires: 60};
var url = s3.getSignedUrl('getObject', params);
console.log('The URL is ', url);

After executing, my console log shows:

The URL is

but I think it should be showing:

The URL is

Why would it place the S3 bucket name before “” in the URL?

In the past it was working fine using this method. Has the AWS SDK changed?



That’s the format of signedURL for AWS s3 bucket. When AWS form a signed user for getObject or putObject this format remain same.

Format for AWS signed url is:

  1. https://
  2. bucketName provided. this is Bucket
  4. fileName provided. This is Key

Since we can’t change the format of coding or URL or function provided by AWS, thus more important then format is Does URL does what you want it to do? Is this URL able to download s3 file and expire after 60 seconds?

Do follow these docs over AWS signed URL.