Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to private S3 Bucket #797

Closed
cklingspor opened this issue Aug 4, 2021 · 3 comments
Closed

Export to private S3 Bucket #797

cklingspor opened this issue Aug 4, 2021 · 3 comments

Comments

@cklingspor
Copy link

cklingspor commented Aug 4, 2021

Hi Leon,

I've been playing around with your plugin because I think, that it is a great idea. Currently, I'm looking for a possibility to use the plugin with a private S3 bucket that blocks all public access. I read here: #537 and during the discussion, the requester mentioned that everything runs smoothly after the S3 bucket does not block public access anymore.
I also checked that I have this code in place: https://staticword.press/t/publishing-static-pages-as-private-in-s3/61/4

Also here is my error message from logs:
PHP Fatal error: Uncaught exception 'Aws\\S3\\Exception\\S3Exception' with message 'Error executing "PutObject" on "https://s3.eu-central-1.amazonaws.com/BUCKETNAME/wp_sitemap.xml"; AWS HTTP error: Client error: PUT https://s3.eu-central-1.amazonaws.com/BUCKETNAME/wp_sitemap.xml resulted in a 403 Forbidden response:\n<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>W0W1HC (truncated...)\n AccessDenied (client): Access Denied - <?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>AccessDenied</Code><Message>Access Denied</Message>

I receive the same error message and made sure, that the IAM policy contains the exact permissions to upload to the bucket.

Also, I'm wondering if the bucket URL is okay...

Is there any update on the issue?

@leonstafford
Copy link
Contributor

Hi @cklingspor,

Just to check - what was the resolution for you in this case?

Even if unrelated, I'm always happy to hear and maybe someone is facing similar issue.

Cheers,

Leon

@cklingspor
Copy link
Author

Hi Leon,

thanks for getting back to me so fast! I had to leave the desk and did plan to write a comment about the "solution".
So here are more details:
As I said in my original post I've checked the issue here #537 and also made sure the S3 addon supports private ACL on the bucket. So the first step to the solution was understanding what the problem was: The bucket is private and blocked all public access:
grafik

I was looking around, thought about S3 URL formats and what not, and then found the following switch in the "addons"-menu in the WP2Static Plugin:

  1. Click on the configure button:
    grafik
  2. Setting this to "private" solves all the issues:
    grafik

Best
Christoph

@leonstafford
Copy link
Contributor

Ah, great to hear, thanks for sharing, @cklingspor! I think that's @john-shaffer's handy work, adding the Object ACL controls in prior enhancement - nice to hear it's working well for people!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants