Skip to content

Commit

Permalink
pass a blank string to boto for region if using us-east-1
Browse files Browse the repository at this point in the history
  • Loading branch information
neiltron committed Dec 4, 2016
1 parent 55d2f01 commit bea726b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/ec2gaming-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ BUCKET="ec2gaming-$ACCOUNT_ID"
if ! aws s3api head-bucket --bucket "$BUCKET" &> /dev/null; then
echo -n "not found. Creating... "
REGION=$(aws configure get region)

if REGION == 'us-east-1'; then
REGION=''
fi

aws s3api create-bucket --bucket "$BUCKET" --region "$REGION" --create-bucket-configuration LocationConstraint="$REGION" > /dev/null
fi
sed "s/BUCKET/$BUCKET/g;s/USERNAME/$USERNAME/g;s/PASSWORD/$PASSWORD/g" ec2gaming.bat.template > ../ec2gaming.bat
Expand Down

1 comment on commit bea726b

@mhluska
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a reference error "REGION: command not found". It needs to be $REGION.

Please sign in to comment.