Hi everyone, I'm currently preparing for the AWS SAA-C03 certification and decided to build a React portfolio website as part of my learning process. I've set up an S3 bucket for static website hosting with the right public access settings, added a bucket policy, configured CORS, and established a CI/CD pipeline through GitHub Actions to automate deployment. However, when trying to access my site via the CloudFront URL, I encounter an 'Access Denied' error. I've verified my bucket permissions, CloudFront settings, and that the origin points correctly to the S3 bucket. I'm unsure what I'm missing — could this be related to Origin Access Identity (OAI) or Origin Access Control (OAC)? Any help would be appreciated!
1 Answer
You should check what infrastructure as code (IaC) you're using. There's a lot of guidance on setting this up. A couple of things to keep in mind: your S3 bucket should not be public and shouldn't be configured for static hosting. Also, always ensure you're using HTTPS for security reasons.
I tried making the bucket private and using OAC, but still hit a wall. I rebuilt my distribution, disabled static hosting, and added redirects for HTTP to HTTPS in my distribution settings. Just to clarify, I'm manually deploying, not using any IaC.