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.

Hello guys, I have some issues to make work a DO spaces presign url in aws golang sdk. I have the following code snippet:
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/labstack/echo"
"log"
"net/http"
"parameters"
"time"
)
key := parameters.ObjectStorageKey
secret := parameters.ObjectStorageSecret
s3Config := &aws.Config{
Credentials: credentials.NewStaticCredentials(key, secret, ""),
Endpoint: aws.String(parameters.ObjectStorageEndpoint),
Region: aws.String(parameters.ObjectStorageRegion),
}
newSession, err := session.NewSession(s3Config)
if err != nil {
return "", err
}
s3Client := s3.New(newSession)
req, _ := s3Client.GetObjectRequest(&s3.GetObjectInput{
Bucket: aws.String(parameters.ObjectStorageBucketErp),
Key: aws.String("MY_OBJECT_KEY"),
})
urlStr, header, err := req.PresignRequest(10 * time.Minute)
if err != nil {
log.Print(err)
}
log.Print(urlstr)
It is generating the url, but when I put it to browser it gives me access denied error. When I generate a link in the control panel it is working without any issue.
What I experienced there is a difference in the link generated by my code and in the control panel.
Link generated in the control panel look like this:
https://fra1.digitaloceanspaces.com/**MY_BUCKET**/MY_OBJECT_KEY
Link generated by my code is like this:
https://MY_BUCKET.fra1.digitaloceanspaces.com/MY_OBJECT_KEY
I don’t know if its cause the problem or not, but I stuck here… Is there anything what I’m doing wrong?
Thanks!
SarkariResultht
KFSys
Arne van Hoorn
alexdo
4287c71658bd4ea39bef277d491b1c
4287c71658bd4ea39bef277d491b1c
Demanix
Demanix
devjk1
Jordan
LC Labs Sp. z o.o.
a0cd9be01b14447384f79073fc121f