From e06449aee3946c2d2a42c086b040870f40f45e50 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 7 Jan 2020 12:29:42 +0100 Subject: [PATCH] Allow specifying an alternate region for db2fog backups --- config/initializers/db2fog.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/initializers/db2fog.rb b/config/initializers/db2fog.rb index 25170029cd..ba5b9c7e1d 100644 --- a/config/initializers/db2fog.rb +++ b/config/initializers/db2fog.rb @@ -8,4 +8,8 @@ DB2Fog.config = { :provider => 'AWS' } -DB2Fog.config[:region] = ENV['S3_REGION'] if ENV['S3_REGION'] +region = ENV['S3_BACKUPS_REGION'] || ENV['S3_REGION'] + +# If no region is defined we leave this config key undefined (instead of nil), +# so that db2fog correctly applies it's default +DB2Fog.config[:region] = region if region