From 1b99543e2e0b2fa68e572d74be20277393f8b2b1 Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 9 Aug 2023 10:55:10 -0700 Subject: [PATCH 1/2] add endpoint to S3 constructor --- brave/s3.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/brave/s3.js b/brave/s3.js index 8f63e79..f73ed18 100644 --- a/brave/s3.js +++ b/brave/s3.js @@ -13,7 +13,8 @@ const debugLib = require('./debug') const globalS3 = new S3({ apiVersion: '2006-03-01', - region: 'us-west-2' + region: 'us-west-2', + endpoint: 'https://s3.us-west-2.amazonaws.com' }) const list = async (bucket, prefix) => { From 4154d51572e432061925808e9f60dbd0f3a77edc Mon Sep 17 00:00:00 2001 From: Anton Lazarev Date: Wed, 9 Aug 2023 11:15:37 -0700 Subject: [PATCH 2/2] use AWS_REGION from environment --- brave/s3.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/brave/s3.js b/brave/s3.js index f73ed18..1ce927f 100644 --- a/brave/s3.js +++ b/brave/s3.js @@ -13,8 +13,7 @@ const debugLib = require('./debug') const globalS3 = new S3({ apiVersion: '2006-03-01', - region: 'us-west-2', - endpoint: 'https://s3.us-west-2.amazonaws.com' + region: process.env.AWS_REGION || 'us-west-2' }) const list = async (bucket, prefix) => {