Wordpress W3 Total Cache CDN setup cannot find Cloudfront distribution endpoint

632 Views Asked by At

I'm in the final stages of setting up W3 Total Cache. When configuring the W3TC CDN, I'm getting this error when I click on the Test S3 Upload and Cloudfront Distribution button:

Error: Distribution for origin "bucket-name.s3.amazonaws.com" not found.

I have only one distribution, and this is my policy:

"Effect": "Allow",
"Action": "cloudfront:ListDistributions",
"Resource": "*"

What I think is causing it is, the distribution endpoint should be "bucket-name.s3.us-east-1.amazonaws.com", but W3TC is looking for "bucket-name.s3.amazonaws.com".

The CF distribution should point to the regional bucket endpoint and not the global one, which is considered AWS best practice to avoid redirects. W3TC is apparently looking for the global endpoint.

W3TC support recommended building the distribution from the plugin side, which I tried to do. However, the plugin complains that the bucket already exists and ends there.

Any suggestions?

1

There are 1 best solutions below

0
On

Found out W3TC does not support the region-based bucket name, only the shorter name.

I solved the problem by renaming the origin in Cloudfront's Distribution settings with the region removed, e.g. bucket-name.s3.amazonaws.com