Skip to content

Instantly share code, notes, and snippets.

@apal21
Created January 25, 2019 19:10
Show Gist options
  • Save apal21/27068f0ac8177a9fd10f861c6342d794 to your computer and use it in GitHub Desktop.
Save apal21/27068f0ac8177a9fd10f861c6342d794 to your computer and use it in GitHub Desktop.
AWS S3 getSignedUrl synchronously
const s3 = new AWS.S3(accessparams);
const url = s3.getSignedUrl('getObject', {
Bucket: 'BUCKET-NAME',
Key: 'path/to/your/file',
Expires: 60 * 5 // time in seconds: e.g. 60 * 5 = 5 mins
})
console.log(url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment