s3cmd and GovCloud

If you're using s3cmd to put files into an s3 bucket and need to do so into GovCloud you can, but you need to override the end point URL's used for s3.  I had a hard time finding documentation for this, so hopefully this saves someone sometime in the future.

s3cmd writes a configuration file, likely at ~/.s3cfg and in it are two options that you are not prompted for when going through the setup process, but are relevant when connecting to GovCloud.  Specifically 'host_base' and 'host_bucket' need to be changed from the default s3 end points, they need to be set like so:

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

Once these are set your GovCloud access key and secret should work.

Do you want to get new posts from lemonbytes directly in your inbox? Subscribe today!