feat(medusa-file-s3): Allow all AWS options in config (#2809)
This commit is contained in:
@@ -124,6 +124,33 @@ const plugins = [
|
||||
];
|
||||
```
|
||||
|
||||
### Add AWS Configurations
|
||||
|
||||
You can pass AWS configurations in the plugin's options under the property `aws_config_object`. This property is an object that accepts [AWS Configurations](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html) as its properties.
|
||||
|
||||
For example, you can pass the `region`, `access_key_id` and `secret_access_key` in `aws_config_object`:
|
||||
|
||||
```jsx title=medusa-config.js
|
||||
const plugins = [
|
||||
//...
|
||||
{
|
||||
resolve: `medusa-file-s3`,
|
||||
options: {
|
||||
s3_url: process.env.S3_URL,
|
||||
bucket: process.env.S3_BUCKET,
|
||||
aws_config_object: {
|
||||
region: process.env.S3_REGION,
|
||||
access_key_id: process.env.S3_ACCESS_KEY_ID,
|
||||
secret_access_key: process.env.S3_SECRET_ACCESS_KEY,
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
```
|
||||
|
||||
Make sure to define `S3_REGION`, `S3_ACCESS_KEY_ID`, and `S3_SECRET_ACCESS_KEY` in your environment variables first.
|
||||
|
||||
|
||||
:::caution
|
||||
|
||||
If you have multiple storage plugins configured, the last plugin declared in the `medusa-config.js` file will be used.
|
||||
|
||||
Reference in New Issue
Block a user