Last active
July 14, 2020 17:21
-
-
Save jashimcse/71aadcb2ea5097ec342ee9e5fe1a503f to your computer and use it in GitHub Desktop.
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
AWS Cloudfront instalation | |
In this code I share the two policies that need to be used to setup the S3 bucket properly. | |
1) This policy is applied on the S3 bucket to enable public access: | |
{ | |
"Version": "2008-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::mywpmedia2018/*" | |
} | |
] | |
} | |
2. This policy below enabled the User access to the S3 bucket | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:CreateBucket", | |
"s3:DeleteObject", | |
"s3:Put*", | |
"s3:Get*", | |
"s3:List*" | |
], | |
"Resource": [ | |
"arn:aws:s3:::mywpmedia2018", | |
"arn:aws:s3:::mywpmedia2018/*" | |
] | |
} | |
] | |
} | |
Remember to replace the bucket names with your bucket names. | |
This following piece of code is what you put in the wp-config.php file | |
define( 'AS3CF_AWS_ACCESS_KEY_ID', '********************' ); | |
define( 'AS3CF_AWS_SECRET_ACCESS_KEY', '**************************************' ); | |
Remember to replace the asterisks with the keys you will generate as part of the User setup in the AWS Console (IAM Service). | |
you can use WP Config File Editor for wp-file config edith Jashimcse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment