I am executing the following code but getting error
//preparing upload parameters
const params = {
Bucket: `${config.s3bucket}`,
Key: `${objectDirectory}/${objectKey}`,
};
//geenerating signed url, valid only for 15 minutes
const command = new PutObjectCommand(params);
const signedUrl = await getSignedUrl(s3Client, command, {
expiresIn: 900,
});
Code 2
const bucketParams = {
Bucket: config.s3bucket,
Key: `Profiles/${result.profilePicture}`,
};
const command = new GetObjectCommand(bucketParams);
const urls = await getSignedUrl(s3Client, command, {
expiresIn: 60 * 60 * 168,
});
Error Message:
{
"message": "TypeError: Cannot read properties of undefined (reading 'sso_session')"
}
the error occurs whenever I am executing getSignedUrl
2
Answers
Same is happening to me, rolling back @aws-sdk/s3-request-presigner to 3.208.0 as said in https://github.com/aws/aws-sdk-js-v3/issues/4183 didn’t work
I am assuming that you are using 2 stacks and trying to call properties from stack1 in stack2:
Try making it a "publicly readonly" in the 1st stack and in the 2nd stack create an interface to hold the signedURL information.