feat(medusa-file-s3): Allow all AWS options in config (#2809)
This commit is contained in:
1 parent
4ef0bffff9
commit
79cddc23da
4 files changed
+47
-10
No files matched your search
@@ -14,6 +14,7 @@ class S3Service extends AbstractFileService {
|
||||
this.secretAccessKey_ = options.secret_access_key
|
||||
this.region_ = options.region
|
||||
this.endpoint_ = options.endpoint
|
||||
this.awsConfigObject_ = options.aws_config_object
|
||||
}
|
||||
|
||||
upload(file) {
|
||||
@@ -122,16 +123,17 @@ class S3Service extends AbstractFileService {
|
||||
|
||||
updateAwsConfig(additionalConfiguration = {}) {
|
||||
aws.config.setPromisesDependency(null)
|
||||
aws.config.update(
|
||||
{
|
||||
accessKeyId: this.accessKeyId_,
|
||||
secretAccessKey: this.secretAccessKey_,
|
||||
region: this.region_,
|
||||
endpoint: this.endpoint_,
|
||||
...additionalConfiguration,
|
||||
},
|
||||
true
|
||||
)
|
||||
|
||||
const config = {
|
||||
...additionalConfiguration,
|
||||
accessKeyId: this.accessKeyId_,
|
||||
secretAccessKey: this.secretAccessKey_,
|
||||
region: this.region_,
|
||||
endpoint: this.endpoint_,
|
||||
...this.awsConfigObject_,
|
||||
}
|
||||
|
||||
aws.config.update(config, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user