Skip to content

Switch Content S3 Bucket to Use CloudFront Origin Access Control v2 - #419

Merged
molly-moen merged 2 commits into
mainfrom
molly-bucket-fix
Aug 4, 2026
Merged

Switch Content S3 Bucket to Use CloudFront Origin Access Control v2#419
molly-moen merged 2 commits into
mainfrom
molly-bucket-fix

Conversation

@molly-moen

@molly-moen molly-moen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This PR builds on #415, which breaks theater and prompter.
From #415:

We're no longer able to provision new Javabuilder Stacks. CloudFormation cannot provision the ContentBucketPolicy because of the BlockPublicPolicy setting.
Switch to using CloudFront Origin Access Control to enable students/teachers (the public) to fetch Objects in this bucket.
The Javabuilder Lambdas still have access through their Roles to read/write Objects in this Bucket.

This adds the following:

  • Don't forward query strings, as we add cache bust urls that were causing the theater requests to fail. The query string will still work for cache busting, but won't cause a 403 anymore.
  • Update the prompter urls to no longer route through Cloudfront, and instead use the raw S3 url. Per Claude "with OAC set to always, CloudFront adds its own SigV4 auth while forwarding the X-Amz-* presigned query params, and S3 rejects requests carrying two auth mechanisms ("Only one auth mechanism allowed"). The bucket policy also only grants s3:GetObject, so a CloudFront-signed PUT is denied regardless."

I deployed a dev instance with this change and it deployed and theater and prompter work as expected.

sureshc and others added 2 commits June 12, 2026 13:59
…cts in the content bucket.

Co-authored-by: Claude <noreply@anthropic.com>
@molly-moen
molly-moen marked this pull request as ready for review August 3, 2026 16:54
@molly-moen
molly-moen requested review from a team, cat5inthecradle and sureshc August 3, 2026 16:54

@cat5inthecradle cat5inthecradle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@molly-moen
molly-moen merged commit be43f84 into main Aug 4, 2026
1 check passed
@molly-moen
molly-moen deleted the molly-bucket-fix branch August 4, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants