DEV Community

Sanjay
Sanjay

Posted on

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

Top comments (0)