diff --git a/storage/s3.go b/storage/s3.go index 934b9c1..1ef01b8 100644 --- a/storage/s3.go +++ b/storage/s3.go @@ -67,7 +67,11 @@ func NewS3Client(cfg Cfg) (*S3Client, error) { } if !cfg.UseIAM { - awsCfg.Credentials = credentials.NewStaticCredentialsProvider(cfg.AK, cfg.SK, "") + if len(cfg.AK) != 0 && len(cfg.SK) != 0 { + awsCfg.Credentials = credentials.NewStaticCredentialsProvider(cfg.AK, cfg.SK, "") + } else { + awsCfg.Credentials = aws.AnonymousCredentials{} + } } return &S3Client{cli: s3.NewFromConfig(awsCfg)}, nil }