Skip to content

Commit

Permalink
Merge pull request #88 from zalando/bugfix/set_wale_region_to_bucket
Browse files Browse the repository at this point in the history
Use the bucket region for WAL-E Endpoint
  • Loading branch information
feikesteenbergen committed Sep 7, 2016
2 parents aeef1e8 + 23183f3 commit 9cf02b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion postgres-appliance/configure_spilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,12 @@ def write_wale_command_environment(placeholders, overwrite, provider):
if provider == PROVIDER_AWS:
write_file('s3://{WAL_S3_BUCKET}/spilo/{SCOPE}/wal/'.format(**placeholders),
os.path.join(placeholders['WALE_ENV_DIR'], 'WALE_S3_PREFIX'), overwrite)
write_file('https+path://s3-{}.amazonaws.com:443'.format(placeholders['instance_data']['zone'][:-1]),
match = re.search(r'.*(eu-\w+-\d+)-.*', placeholders['WAL_S3_BUCKET'])
if match:
region = match.group(1)
else:
region = get_instance_meta_data('placement/availability-zone')[:-1]
write_file('https+path://s3-{}.amazonaws.com:443'.format(region),
os.path.join(placeholders['WALE_ENV_DIR'], 'WALE_S3_ENDPOINT'), overwrite)
elif provider == PROVIDER_GOOGLE:
write_file('gs://{WAL_GCS_BUCKET}/spilo/{SCOPE}/wal/'.format(**placeholders),
Expand Down

0 comments on commit 9cf02b0

Please sign in to comment.