Rachel
Rachel

Reputation: 117

AWS Deployment 403 forbidden

I'm deploying my static website via AWS, and after changing some files in my Bucket, my AWS endpoint is giving me a '403 Forbidden' error when I try and access the site. Anyone have any ideas why?

Upvotes: 1

Views: 2425

Answers (2)

Rachel
Rachel

Reputation: 117

Thanks Frédéric ^^^

Going to the AWS S3 console, and under 'Permissions' - it was the 'edit policy' component that was the problem.

The policy I used can be found here:

http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html

It worked a treat!

Upvotes: 1

Frederic Henri
Frederic Henri

Reputation: 53733

If I understand correctly you're deploying static web site from S3 bucket, can you make sure the permissions are added to your bucket ?

  1. Open the Amazon S3 console at https://console.aws.amazon.com/s3/.

  2. In the Buckets pane, choose your root domain bucket, choose Properties, choose Permissions, and then choose Add bucket policy to open the Bucket Policy Editor.

  3. Copy the following policy and paste it into the Bucket Policy Editor. In the Amazon Resource Name (ARN) for the resource in the "Resource" entry, replace example.com with the name of your bucket, and then choose Save. This policy gives everyone permission to view any file in the example.com bucket.

    {
      "Version":"2012-10-17",
      "Statement": [{
        "Sid": "Allow Public Access to All Objects",
        "Effect": "Allow",
        "Principal": "*",
        "Action": "s3:GetObject",
        "Resource": "arn:aws:s3:::example.com/*"
      }
     ]
    }
    

Upvotes: 3

Related Questions