Im using the following code to generate the pre-signed url using aws sdk in javascript.
const aws = require("aws-sdk");
const s3 = new aws.S3();
AWS.config.update({
accessKeyId: "generated access key",
secretAccessKey: "generated secret key"
})
const s3_param = {
Bucket: "bucket-name",
Key: "file-name"
}
const signedUrl = s3.getSignedUrl("putObject", s3_params);
console.log(signedUrl);
This is giving me undefined
. If I pass the callback as the 3ed argument, it is not executing the callback at all. What am I missing here?