CloudFront 403 Errors on S3 Sites Often Stem from Path Mismatch, Not IAM Issues

Developers deploying Angular front-ends to S3 with CloudFront via Origin Access Control (OAC) may encounter a 403 Access Denied error even when all IAM permissions are correctly configured. The root cause, as documented in a recent CI/CD debugging case using Bamboo, is often a mismatch between where build artifacts land in the S3 bucket and where CloudFront's origin path is set to look. Because S3 and CloudFront return the same generic Access Denied response for both permission failures and missing objects, the error misleadingly points developers toward IAM policies. Running 'aws s3 ls' recursively on the bucket can quickly reveal whether files are nested in a subfolder like '/browser/' instead of the expected bucket root. The fix involves either adjusting the build tool's output path to match the CloudFront origin setting, or updating the CloudFront origin path to point directly at the subfolder where files actually reside.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in