AWS Cli sync with non DNS compatible bucket

2019-07-17 11:08发布

问题:

Is there any way to use AWS command line to sync a local folder with a bucket that contains periods '.'?

If I do this:

aws s3 sync local_folder/ s3://files.domain.com/backup

I get this error:

fatal error: Bucket named files.domain.com is not DNS compatible. Virtual hosted-style addressing cannot be used. The addressing style can be configured by removing the addressing_style value or setting that value to 'path' or 'auto' in the AWS Config file or in the botocore.client.Config object.

I already tried removing or changing the addressing_style value in the AWS config, but didn't work. I have no idea how to change on botocore.

AWS Config

[default]
output = json
region = us-west-1
s3 =
  max_concurrent_requests = 100
  max_queue_size = 10000
  multipart_threshold = 64MB
  multipart_chunksize = 16MB
  use_accelerate_endpoint = true

回答1:

It seems I found the problem.

use_accelerate_endpoint = true

Transfer acceleration is not supported for buckets with periods (.) in their names: Amazon S3 Transfer Acceleration.

This means that use_accelerate_endpoint must be removed or set to false. Otherwise, it won't work and will throw that error, making you think it can work with the right settings, when in fact you need to remove the flag.