How do I configure AWS SDK JS v3 to connect to linode?
Hi,
I am a happy linode user, but last week I came across a problem, I want to use JS AWS SDK for S3 (object storage). I spend the whole weekend trying to get a js script to work to list the buckets, it works with the CLI, but somehow using aws-sdk-js-v3 I always get a 403 SignatureDoesNotMatch error.
Is there a workaround for that? Why is JS not included in the docs? Just curious about the second question.
2 Replies
Hi! It looks like some other folks have had success when they have made sure to use the the endpoint in their configuration.
In this previous post in the Community Questions site the user @andysh says,
The only difference is you will need to pass an “endpoint” into the client constructor specifying “https://[location].linodeobjects.com”, where [location] is one of the object storage cluster names:
- us-east-1 (Newark)
- eu-central-1 (Frankfurt)
- ap-south-1 (Singapore)
- us-southeast-1 (Atlanta)
Additionally, in this post on StackOverflow titled Linode Storage With NodeJs, the answer is similar:
"The only hurdle here was to configure the endpoint. With AWS S3 you put the region, with linode you put the endpoint instead."
You may refer this for example that i did previously. https://github.com/teckwei/linode-script/blob/main/file-upload-via-aws-sdk-s3-javscript-v3/file-upload-via-AWS-SDK-Javascript-v3.js