Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

I'm using the AWS S3 CLI to sync two buckets, following the Amazon CLI S3 SYNC format specified in the documentation, as follows:

aws s3 sync s3://source_bucket s3://target_bucket --exclude *.tmp

But I get the following error:

A region must be specified --region or specifying the region in a configuration file or as an environment variable. Alternately, an endpoint can be specified with --endpoint-url

I have scoured the internet in addition to AWS CLI docs and find no reference to --region in the context of S3 SYNC. Any guidance would be appreciated!

Probably immaterial, but I am running Mac OS X Mavericks 10.9.1 on an MBPr (16GB RAM, 512GB SSD, quad-core)

1 Answer

0 votes
by (44.4k points)

You can set the AWS_DEFAULT_REGION environment variable.

export AWS_DEFAULT_REGION="us-east-1"

Related questions

+1 vote
1 answer
Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...