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

Error putting S3 policy: AccessDenied: Access Denied #5

Open
mikeyudin opened this issue Mar 4, 2021 · 3 comments
Open

Error putting S3 policy: AccessDenied: Access Denied #5

mikeyudin opened this issue Mar 4, 2021 · 3 comments
Assignees

Comments

@mikeyudin
Copy link

While attempting to run this module, I am getting Error putting S3 policy: AccessDenied: Access Denied when tf attempts to assign a policy to the fqdn bucket. I believe because it's trying to assign a bucket policy to a bucket that blocks public access (https://aws.amazon.com/premiumsupport/knowledge-center/s3-access-denied-bucket-policy/).

It works perfectly if I do not assign the policy to the bucket. Any ideas why this is happening? Are there drawbacks to excluding this policy if the bucket is private?

Thank you for your work on this module. It is very helpful!

@ronaldtse ronaldtse self-assigned this Mar 5, 2021
@ronaldtse
Copy link
Contributor

Thanks @mikeyudin for the report! The S3 bucket policy here is used to allow CloudFront access, because CloudFront is used to serve the redirect while the S3 bucket is kept private.

Can you provide a bit more detail for reproduction purposes:

  • are you using this on a vanilla setup?
  • is this module managing the S3 bucket for you?

Thanks!

@mikeyudin
Copy link
Author

@ronaldtse I copied and pasted www-redirect config from your main repo and ran this. I have S3 set to block all public access by default for buckets, and I am letting the module manage the S3 bucket.

Please let me know if there's any other info I can provide. For now I commented out the "policy" line from s3.tf.

@ronaldtse
Copy link
Contributor

@mikeyudin sorry for the late reply here. @phuonghuynh would you be able to check this? Thanks!

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