From cdf069abbcbe80d0b511243eec5b1d40a7f7fc4b Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 15 Jun 2022 12:42:41 +0100 Subject: [PATCH] Use s3 region from datasource config --- packages/server/src/api/controllers/static/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/static/index.js b/packages/server/src/api/controllers/static/index.js index 2880e453ca..c66db08983 100644 --- a/packages/server/src/api/controllers/static/index.js +++ b/packages/server/src/api/controllers/static/index.js @@ -17,7 +17,6 @@ const { attachmentsRelativeURL } = require("../../../utilities") const { DocumentTypes } = require("../../../db/utils") const { getAppDB, getAppId } = require("@budibase/backend-core/context") const AWS = require("aws-sdk") -const AWS_REGION = env.AWS_REGION ? env.AWS_REGION : "eu-west-1" async function prepareUpload({ s3Key, bucket, metadata, file }) { const response = await upload({ @@ -115,6 +114,7 @@ exports.getSignedUploadURL = async function (ctx) { // Determine type of datasource and generate signed URL let signedUrl let publicUrl + const AWS_REGION = datasource?.config?.region ?? "eu-west-1" if (datasource.source === "S3") { const { bucket, key } = ctx.request.body || {} if (!bucket || !key) {