Cloudformation template for code pipeline with SPA React app and AWS resources: S3 and Cloudfront.
This isn't the complete solution as I was kind of putting things together. You may have issue with configuring Rout53, Cloudfront, and S3 but it will be simple to figure them out. Check References
section.
In-depth tutorial on adding Cloudfront invalidation step.
https://github.com/aws-samples/react-cors-spa/blob/main/react-cors-spa-stack.yaml https://www.youtube.com/watch?v=EWoSmgfTErM