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

Bucket policy correction #144

Open
Dev4rno opened this issue Apr 14, 2023 · 3 comments
Open

Bucket policy correction #144

Dev4rno opened this issue Apr 14, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Dev4rno
Copy link

Dev4rno commented Apr 14, 2023

Hi, firstly thanks for this awesome package! I integrated this into my app a while back and I absolutely love it. After a long needed update of all my npm packages, I noticed the documentation and setup for this had slightly changed since the last time I checked, so I decided to start from scratch.

After creating a new bucket and IAM user as described in the docs, I was receiving an irritating PUT: 403 Access Denied, and after some quick research I found: The "403 Forbidden" error can occur due to the following reasons: Permissions are missing for s3:PutObject to add an object or s3:PutObjectAcl to modify the object's ACL.

I noticed that the suggested bucket policy only contains "Action": "s3:GetObject", and after modifying this to "Action": [ "s3:GetObject", "s3:PutObject"]" everything started working fine and dandy. I'm still not sure if this was an error on my behalf but I really followed the documentation as strictly as possible, and just thought that this would be worth mentioning.

Thanks again for making the upload process so simple 👍

@ryanto
Copy link
Owner

ryanto commented Apr 20, 2023

Nice catch! Does this updated policy look right?

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Statement1",
      "Effect": "Allow",
      "Principal": "*",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::BUCKET_NAME/*"
    }
  ]
}

@ryanto ryanto added the bug Something isn't working label Apr 21, 2023
@Dev4rno
Copy link
Author

Dev4rno commented May 1, 2023

Sorry for the late reply, yes thats exactly how mine looks!

@ryanto
Copy link
Owner

ryanto commented May 1, 2023

Thanks Alex! I'll do some testing and report back :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants