Hi, I have an app that already uses one S3 bucket using the S3 plugin. However, i need to configure another one for a new collection. Right now my config is as follows:
plugins: [
...plugins,
s3Storage({
enabled: process.env.S3_STORAGE === 'true',
collections: {
media: true, // Apply storage to 'media' collection
},
bucket: process.env.S3_BUCKET
'','',
secretAccessKey: process.env.S3_SECRET
'','',
},
}),
],
If i want to define another bucket, do I just simply create another instance of s3Storage, or is there a more appropriate way?
Yes, if you want it to go to different buckets you create another instance of the s3storage plugin.
Note that there was a recent bug with how multiple storage plugins shared the cache. So make sure you are at version 3.62.0 or newer.
Ref:
https://github.com/payloadcms/payload/pull/14267Thanks
Star
Discord
online
Get dedicated engineering support directly from the Payload team.