Comments (6)
Ok, after some experimentation, found the minimal permissions for bucket and plugin setup is:
{
s3Options: {
// ...
},
s3UploadOptions: {
ACL: '',
Bucket: 'YOURBUCKET'
}
}
IAM > Users > YOURUSER > Permissions > Add inline policy (JSON):
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::YOURBUCKET/*"
}
]
}
S3 > YOURBUCKET > Permissions > Block public access: All "OFF"
S3 > YOURBUCKET > Permissions > Bucket Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOURBUCKET/*"
}
]
}
from s3-plugin-webpack.
It would be nice to see documented exactly which actions are required for this plugin to work. I do not like giving more privileges than necessary. I use the following policy for other services and it works. But with s3-plugin-webpack
I get Access Denied
. So what else is this plugin trying to do?
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::mybucket/*"
}
]
}
Another policy example is in issue #62.
from s3-plugin-webpack.
This is really helpful @SunSparc :) I'll try to upstream a doc change when I'm next using this plugin
from s3-plugin-webpack.
Well, after going through all the permissions myself it turns out that s3-plugin-webpack
also needs the PutObjectAcl
by default, unless ACL: "",
is added to the s3UploadOptions
, which was mentioned on #28.
from s3-plugin-webpack.
@patcon Does
{
s3Options: {
// ...
},
s3UploadOptions: {
ACL: '',
Bucket: 'YOURBUCKET'
}
}
"YOURBUCKET" have to be a hardcoded string? Having a difficult time passing this value from an .env using process.env
or even using an environment.js
file that takes the .env vars and exports them to webpack.
from s3-plugin-webpack.
I don't think so, @mapineda :(
from s3-plugin-webpack.
Related Issues (20)
- Help, how to specify relaxed root caching policy? HOT 5
- Problem with directory option HOT 1
- endpoint-url option HOT 2
- Feature request: done callback with uploaded items HOT 2
- Any hook could I know that the upload process is finished ? HOT 1
- Upload Triggers too Early in Build Process HOT 10
- cloudfrontInvalidateOptions not compatible with s3options.credentials
- Reading file from AWS giving 403 Access denied error HOT 1
- [FeatureRequest] add CloudFront support HOT 1
- ERR_INVALID_ARG_TYPE (undefined) after upgrade to Webpack 5 HOT 13
- Progress bar not working correctly HOT 3
- Is there a way I can INVALIDATE CDN Distribution ONLY if the file content has changed ?
- Using basePathTransform produces TypeError: this.basePathTransform is not a function HOT 1
- option directory How to specify multiple directories HOT 2
- upload unchanged files HOT 2
- Broken urls replacement
- aws sdk ^2.x is raising warnings HOT 1
- Invalid version inside package.json?
- Release new version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s3-plugin-webpack.