Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions go/vt/mysqlctl/s3backupstorage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ var (
// AWS API region
region = flag.String("s3_backup_aws_region", "us-east-1", "AWS region to use")

// AWS request retries
retryCount = flag.Int("s3_backup_aws_retries", -1, "AWS request retries")

// AWS endpoint, defaults to amazonaws.com but appliances may use a different location
endpoint = flag.String("s3_backup_aws_endpoint", "", "endpoint of the S3 backend (region must be provided)")

Expand Down Expand Up @@ -340,14 +343,20 @@ func (bs *S3BackupStorage) client() (*s3.S3, error) {
if err != nil {
return nil, err
}
bs._client = s3.New(session,
&aws.Config{
HTTPClient: httpClient,
LogLevel: logLevel,
Endpoint: aws.String(*endpoint),
Region: aws.String(*region),
S3ForcePathStyle: aws.Bool(*forcePath),
})

awsConfig := aws.Config{
HTTPClient: httpClient,
LogLevel: logLevel,
Endpoint: aws.String(*endpoint),
Region: aws.String(*region),
S3ForcePathStyle: aws.Bool(*forcePath),
}

if *retryCount >= 0 {
awsConfig.WithMaxRetries(*retryCount)
}

bs._client = s3.New(session, &awsConfig)

if len(*bucket) == 0 {
return nil, fmt.Errorf("-s3_backup_storage_bucket required")
Expand Down