Use the correct region for the S3 bucket

We may not have created the bucket!
This commit is contained in:
Justin Santa Barbara 2015-03-27 12:57:34 -07:00
parent 473b98a344
commit 194143e61b

View File

@ -236,8 +236,9 @@ function upload-server-tars() {
aws s3 mb "s3://${AWS_S3_BUCKET}" --region ${AWS_S3_REGION}
fi
local s3_url_base=https://s3-${AWS_S3_REGION}.amazonaws.com
if [[ "${AWS_S3_REGION}" == "us-east-1" ]]; then
local s3_bucket_location=$(aws --output text s3api get-bucket-location --bucket ${AWS_S3_BUCKET})
local s3_url_base=https://s3-${s3_bucket_location}.amazonaws.com
if [[ "${s3_bucket_location}" == "us-east-1" ]]; then
# us-east-1 does not follow the pattern
s3_url_base=https://s3.amazonaws.com
fi