Last active
August 17, 2018 18:45
-
-
Save johanneslamers/c7a27bff9a7c8dd5bf90 to your computer and use it in GitHub Desktop.
AMAZON S3 UPER PERMISSIONS FOR CRAFT CMSFrom http://cliveportman.co.uk/code/amazon-s3-user-permissions-for-craft-cms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:PutObject", | |
"s3:PutObjectAcl" | |
], | |
"Resource": "arn:aws:s3:::*" | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": "s3:*", | |
"Resource": "arn:aws:s3:::bucketname" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Finally, if you want the images to show up on the front-end, you need to add a bucket policy: | |
{ | |
"Id": "PolicyXXXXXXXXXXXXXXX", | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "XXXXXXXXXXXXXXXX", | |
"Action": [ | |
"s3:GetObject" | |
], | |
"Effect": "Allow", | |
"Resource": "arn:aws:s3:::bucketname/*", | |
"Principal": "*" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment