Skip to content

Commit

Permalink
remove extra aws config detail
Browse files Browse the repository at this point in the history
  • Loading branch information
allthatjazzleo committed Oct 27, 2024
1 parent e1eaf54 commit 16cff42
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions internal/s3uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
Expand All @@ -19,16 +18,7 @@ type S3Uploader struct {
}

func LoadConfig() (aws.Config, error) {
// read credentials from environment variables
accessKeyId := os.Getenv("AWS_ACCESS_KEY_ID")
accessKeySecret := os.Getenv("AWS_SECRET_ACCESS_KEY")

if accessKeyId == "" || accessKeySecret == "" {
return config.LoadDefaultConfig(context.TODO())
}

return config.LoadDefaultConfig(context.TODO(),
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accessKeyId, accessKeySecret, "")),
config.WithRegion("auto"),
)
}
Expand Down

0 comments on commit 16cff42

Please sign in to comment.