I'm recently migrating from node v14 to v18 which requires AWS SDK v2 upgrade to v3. node v14 to v18
This is how the implementation went
const s3 = new S3Client({ signatureVersion: 'v4' });
try {
let command = new PutObjectCommand(params);
if (flag === 'DOWN') {
command = new GetObjectCommand({
Bucket: params.Bucket,
Key: params.Key,
});
delete params.Metadata;
logger.info({
reqp: { headers: { rid } },
message: `Command invoked is ${command.constructor.name}`,
});
const url = await getSignedUrl(s3, command);
I think there is some issue with how I'm passing params in getSignedUrl function. Please help.