AWS S3 JavaScript SDK getSignedUrl returns base path only

I have very simple code to create an S3 url. The URL I received from the SDK has only the base path for S3. It does not contain anything else. Why is this happening?

var AWS = require('aws-sdk'); var s3 = new AWS.S3(); console.log(s3.getSignedUrl('getObject', { Bucket: 'test', Key: 'test' })); // Returns "https://s3.amazonaws.com/" 

Node.js v0.12.0, AWS SDK 2.1.15 or 2.1.17, Windows 7 64-bit,

+5
source share
1 answer

The problem is not in the code. It turns out, when you do not have your AWS credentials correctly configured in your environment, that the AWS SDK does not complain. Correcting the credentials in ~/.aws/credentials resolved the issue.

+4
source

Source: https://habr.com/ru/post/1215333/


All Articles