Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi all. I’m new to spaces and I can’t seem to get a valid Pre-signed URL with this code. If anyone has pointers or corrections I would really appreciate it. I have also added a wildcard CORS with all permissions.
module.exports = async function (context, req) {
const aws = require('aws-sdk');
var signedURL;
let DO_ENDPOINT = req.body.do_endpoint;
let DO_ACCESS_KEY_ID = req.body.access_key;
let DO_SECRET_ACCESS_KEY = req.body.secret_key;
let DO_SPACE = req.body.bucket;
let DO_GUID = req.body.key;
const spacesEndpoint = new aws.Endpoint(DO_ENDPOINT);
const s3 = new aws.S3({
endpoint: spacesEndpoint,
accessKeyId: DO_ACCESS_KEY_ID,
secretAccessKey: DO_SECRET_ACCESS_KEY,
});
const s3Params = {
Bucket: DO_SPACE,
Key: DO_GUID,
ACL: 'public-read',
Expires: 600,
};
s3.getSignedUrl('putObject', s3Params, function (err, url) {
if (err) {
context.res = {
status: 400,
body: "Something went wrong, please try again."
};
} else {
context.res = {
body: url
};
}
});
};
The error I keep getting is:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>SignatureDoesNotMatch</Code>
<RequestId>tx0000000000000a3a794c8-005d4ad207-11f28ea-ams3a</RequestId>
<HostId>11f28ea-ams3a-ams3</HostId>
</Error>
Niketan Sharma
819167b5336c456e9ad38395fec1c5
SarkariResultht
e3002a14a547406799fe27a6abf211
9e483d26583f44f6bafe369a29b405
keneucker
keneucker
Shamoil Khan
Frederik
f25932a0b984430fb48c4256f1aaad
0a2e7912d2f74bccbaac42bf8f769b