Amplify AccessDenied with PDF file in root folder

0

I'm trying to host a PDF file in the root folder of an otherwise empty Amplify app. I'm deploying the app through GitHub. For some reason I'm getting an AccessDenied error when reaching the PDF file like so: https://www.example.com/myfile.pdf

Everything was setup using the default configuration. index.html in the root folder works just fine. Leaving the PDF is a subfolder also works fine.

What could be wrong? Thanks

질문됨 2년 전655회 조회
2개 답변
0

Good question! I would check your Amplify build settings to see how you have set up your artifacts and the structure for that: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html

The “Access Denied” error tells me that the folder is not initialized correctly.

jsonc
답변함 2년 전
0

Check S3 Bucket Permissions: You can ensure that the S3 bucket associated with your Amplify project has the appropriate permissions to allow public access or authenticated access to the PDF file.

  • Navigate to the Amazon S3 console.
  • Select your bucket.
  • Go to the "Permissions" tab.
  • Review the bucket policy and ensure it allows the necessary access. You might need to add a policy that allows GetObject permissions for public or authenticated users.

Here's an example of an S3 bucket policy allowing public read access:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    }
  ]
}
AWS
답변함 9달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠