While deploying my react website in AWS S3+cloudfront, I found that I can also deploy react website to EC2, Can someone explain to me when should I go for EC2 and when should I choose S3 + CloudFront?
If you haven't developed a backend for your site then go for s3, and if you developed a custom backend (using Django, express, etc) then go for Ec2. S3 is just a storage system but you can also deploy static sites. But ec2 is a VPS. you can do whatever you want with it. And CloudFront is a CDN(Content Delivery Network) just like Cloudflare. You can use Cloudfront with both S3 and Ec2.