3

After attempting to apply a bucket policy generated by Amazon's policy generator, I receive the error "Policy has invalid resource". Everything seems valid after using the policy documentation to check my policy's validity. Here's my simple policy that is throwing the error.

{
  "Id": "Policy1542588337862",
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1542588336654",
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::dylan-landry-cms-portfolio/*",
      "Principal": "*"
    }
  ]
}

Apologies for asking such a common question, but I'm stumped. I'll keep looking into it.

Dylan Landry
  • 1,150
  • 11
  • 27
  • 3
    Your policy works fine for me (substituting my bucket name for yours). You should double-check that your bucket is called `dylan-landry-cms-portfolio`. When I run `aws s3 ls s3://dylan-landry-cms-portfolio`, it says that the Bucket does not exist. – John Rotenstein Nov 19 '18 at 02:33
  • I thought, surely, it could not be that. Turns out it was, I needed to append a "-site" to it. However, now I get an access denied error when I attempt to save it. – Dylan Landry Nov 19 '18 at 13:36
  • To stop the access denied error I had to set "Block new public bucket policies" to false under the Public access settings tab. Thanks for the help John, I will try to be more vigilant and double check what common errors my problem could be due to. – Dylan Landry Nov 19 '18 at 13:43

0 Answers0