feat(medusa-file-s3): Allow all AWS options in config (#2809)

This commit is contained in:
Philip Korsholm authored and GitHub committed 2022-12-20 10:01:30 +01:00
1 parent 4ef0bffff9
commit 79cddc23da
4 files changed
+47 -10

No files matched your search

+3
View File
@@ -13,5 +13,8 @@ Learn more about how you can use this plugin in the [documentaion](https://docs.
region: "eu-west-1"
access_key_id: "YOUR-ACCESS-KEY",
secret_access_key: "YOUR-SECRET-KEY",
aws_config_object : {
// object for aws config properties
}
}
```
+12 -10
View File
@@ -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)
}
}