How to use multiple S3 buckets
See original GitHub issueHello, I’m trying to connect a second S3 bucket to my Node.js companion server.
After looking at the configuration, I did not find any option to specify more than one bucket for the same instance, so I thought about adding a second instance on another route.
So far so good, but as soon as I start the server, I get this error:
TypeError: Cannot add property 1, object is not extensible
at Array.push (<anonymous>)
at ..\node_modules\@uppy\companion\lib\server\logger.js:14:22
at Array.forEach (<anonymous>)
at Object.exports.setMaskables (..\node_modules\@uppy\companion\lib\server\logger.js:13:15)
at maskLogger (..\node_modules\@uppy\companion\lib\companion.js:181:12)
at Object.module.exports.app (..\node_modules\@uppy\companion\lib\companion.js:61:5)
at createUppyCompanion (..\src\routes\uppy\createUppyEndpoint.ts:43:20)
at Object.createUppyEndpoint (..\src\routes\uppy\createUppyEndpoint.ts:16:14)
at Object.<anonymous> (..\src\routes\uppy\uppyArchiveRoute.ts:4:33)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
I can temporary fix this error by commenting out this line:
exports.setMaskables = (maskables) => {
maskables.forEach((i) => {
valuesToMask.push(escapeStringRegexp(i));
});
//Object.freeze(valuesToMask);
};
Now, my question is, if this is a bug or how to support multiple buckets otherwise?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Is it better to have multiple s3 buckets or one bucket with sub ...
If the images are used in different use cases, using multiple buckets will simplify the permissions model, since you can give clients/users ...
Read more >How to serve multiple S3 buckets via single AWS CloudFront ...
In this blog, I will take you step by step on how you can serve content from multiple S3 buckets using a single...
Read more >What is the best, one bucket or multiple bucket? #15 - GitHub
One benefit of the multiple S3 buckets configuration is the ability to have a different configuration (policies) for each bucket, that in turn ......
Read more >How to serve multiple S3 buckets via AWS CloudFront
cloudyvim #s3 #cloudfrontIn this video, we'll go step-by-step on how you can serve content from multiple S3 buckets using a single AWS ...
Read more >Is it better to have multiple s3 buckets or one bucket ... - Reddit
Agreed. multiple buckets means different security groups which is better for security. it also allows for more granular management (you can take ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think just removing object.freeze is not the right way to do it, because then two app instances created with different configs will compete to overwrite this singleton variable, as well as cause issues with the other singletons/globals that are created. I think it boils down to whether we want to do the effort of rewriting all the singleton global state and instead place it inside the companion instance / closure.
if not ,then I think we should throw a better error message if someone tries to initialize the companion app twice.
Well, our system includes several functions, some of which operate with different buckets for the purpose of organization, permissions, etc.
For me, the use of multiple buckets was nothing special. There are several reasons why a server needs to support multiple buckets or even multiple AWS accounts.
So I think it would at least make sense if we could use multiple Uppy instances in the long run, even if they might not run optimized then. If my workaround hadn’t worked, my only option would have been to set up a second server.