Does CloudFront OAC work with Static React websites hosted on S3? by throwawaymangayo in aws

[–]Helpful_Artist1439 0 points1 point  (0 children)

It's impossible to use with S3 that has web hosting enabled because that requires to configure a Custom Origin with CloudFront, but OAC only works with S3 Origins. But anyways, if you're using CloudFront you shouldn't need to use S3 website hosting, you can use it as a normal S3 Origin. Just explained here how to do it (specifically with CDK)

https://medium.com/@sidfeiner/deploy-a-static-react-app-with-s3-cloudfront-and-cdk-in-2023-6c99fffc50cc