gatsby-plugin-s3
gatsby-plugin-s3 copied to clipboard
Don't apply public-read ACL by default
As mentioned previously, AWS now recommend avoiding the use of object ACLs. They have also introduced new features which by default prevent public ACLs from being applied to objects within a bucket. See #38.
I think it's time to change the default behaviour to not include an ACL. As this is a breaking change, this will need a new major version.
I also propose that if acl
is undefined we display a message like "NOTICE: As of gatsby-plugin-s3 x.x.x the public-read ACL is no longer applied by default. You will need to add a public bucket policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html) or specify acl: 'public-read'
in the gatsby-plugin-s3 config. To hide this message, explicitly set acl: null
in the gatsby-plugin-s3 config."
@JoshuaWalsh Good idea about putting up a notice.
I'm not sure if I'm all that keen with making public completely opt in though. I really liked the idea of running the deploy script with no prior existing bucket, and a URL appearing that I could immediately visit with my site on it.
A other solution could be where we just prompt the user what kind of ACL they want if it's set to undefined, this would only happen on bucket creation so it wouldn't be that much of an annoyance.
A downside to this is that CI's can't be prompted/would fail, but in that case we could fall back to a null
acl.