DEV Community

Sanjay
Sanjay

Posted on

2

Static Website Hosting S3,CloudFront - React App

Check npm and node installed or not
npm -v
node -v
Creating a react app
npm create vite@latest
cd
npm install
npm run dev

Image description

Image description
After this the react app look like this

Image description
now open the Vs code and click the .tsx and re write your name,regno.etc...

Image description
Now create S3 Bucket in thw AWS console.

Image description
Block all Public access.
Enable Static Web Hosting.
Edit the Bucket Policy.
Generate bucket Policy &save Changes.

Image description
Upload all the Files and Folders in the dist folder in the React App to the S3 bucket.

Image description
Now Create the Distribution in the Cloud Front.

Image description

Image description

Image description

Image description

Image description
delete cloudfront
delete object in S3
delete Bucket

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay