pgherveou / gulp-awspublish

gulp plugin to publish files to amazon s3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why does it require "public" access to a bucket?

slavafomin opened this issue Β· comments

Hello!

Thank you for this nice tool!

However, why exactly does it require "public" access to a bucket?

I'm serving my content using CloudFront and I want to configure my bucket to be private (I don't want content to be directly accessible). This is considered a best practice in AWS.

I did a quick test and it should work with private buckets (Block all public access: On) by passing { noAcl: true } or a value for the 'x-amz-acl' header:

publisher.publish({}, { noAcl: true });
publisher.publish({ 'x-amz-acl': 'something' });

If it still not working for you, please share your bucket permission so I can investigate.

I wrote this part https://github.com/pgherveou/gulp-awspublish#bucket-permissions and now I realise that it's misleading πŸ™ˆπŸ™ˆπŸ™ˆ The thing is by default, publisher.publish() works only for public bucket. I will reword that part, or you can create a PR if you want πŸ™

@pioug thank you for a quick reply and a suggestion. noAcl: true actually helped to resolve the issue in my case.