Hi, I am trying to setup Tigris, and I follow along the tutorial displayed on Tigris page.
I setup the storage, I setup secrets, and I try to do a simple listing of the buckets from Tigris.
For some reason that I do not know, Tigris does not read the secrets properly. I have tried printing the secrets myself to see if they are there and they are, I used “fly ssh console -C “printenv””. I have then tried to print the secret directly from golang with
log.Println(os.Getenv("AWS_ACCESS_KEY_ID"))
and it works.
sdkConfig, err := config.LoadDefaultConfig(context.TODO()) ----> This fails to get my secrets. Can anyone help me understand why this fails.
sdkConfig, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
log.Printf("Couldn't load default configuration. Here's why: %v\n", err)
return
}
// Create S3 service client
svc := s3.NewFromConfig(sdkConfig, func(o *s3.Options) {
o.BaseEndpoint = aws.String("https://fly.storage.tigris.dev")
o.Region = "auto"
})
result, err := svc.ListObjectsV2(context.TODO(), &s3.ListObjectsV2Input{Bucket: aws.String("bucketName")})
if err != nil {
log.Printf("Unable to list buckets. Here's why: %v\n", err)
}
log.Println("Contents:")
for _, b := range result.Contents {
log.Printf("key=%s size=%d\n", aws.ToString(b.Key), b.Size)
}