How to change the region s3cmd uses?

2010-10-11
2013-02-19
  • I'm trying to change the region s3cmd uses from the standard east region to the west.  Not having much luck so far, I don't see any command line options to change it, so I looked in the .s3cfg file and found these two lines:

    host_base = s3.amazonaws.com
    host_bucket = %(bucket)s.s3.amazonaws.com

    So I figured this would be what i'd need to change and I swapped it to point to the West region's URL:

    host_base = s3-us-west-1.amazonaws.com
    host_bucket = %(bucket)s.s3-us-west-1.amazonaws.com

    But when I updated the config file I get this error when I try to do any commands, so I figure I must have done something wrong:

    WARNING: Retrying failed request: / ( Name or service not known)

     
  • Ok, it looks like I should be able to use -bucket-location with the US West region now, but i'm still having trouble getting it to work.  I'm on the latest version 0.9.9.91 (which looks like it was released in Oct 2010), and looking through svn I see there was a supposed fix put in so the US West region will work back in march 2010, so I thought I would be able to use it now with something like:

    s3cmd -bucket-location=us-west-1 mb s3://someplacetostore.com-test

    but I get the error:

    ERROR: S3 error: 400 (InvalidLocationConstraint): The specified location-constraint is not valid

    when I run this command:

    s3cmd -bucket-location=us-west-1 ls

    It runs ok but it spits out a list of my US *East* buckets.  So i'm left scratching my head about what to do at this point.

     
  • Michal Ludvig
    Michal Ludvig
    2010-10-26

    Hi,

    support for us-west-1 and other locations has been added after 0.9.9.91. I suggest to upgrade to s3cmd 1.0.0 (-rc1).

    BTW filtering "s3cmd ls" output by bucket location is not implemented, but definitely looks like a useful feature.

    Michal

     
  • What is the identifier for other regions? like EU-West and AP-Northeast?