AWS Service Used : S3
The following are the steps to be taken in order to do so:
1. Create a bucket named as test-aws-01
2. Put all default settings while creating bucket
3. Upload or drag build folder files. If react app, run these commands to get production code
npm install
npm run build
4. Go to Properties tab, go to Static website hosting. Enable the static website under static website and host type as host as a static website
5. Specify the home or default page of the page. In the above example, the default file would be index.html
6. You can also add error document if present in your project
7. Make sure that in order to make this project live, you need to remove the blocked public access under permissions
8. Edit a bucket policy, click on Add new statement button from the right side. Search S3 service in the filter search text. Then, search GetObject action in the filter actions
9. Add resource, choose Resource Object as object. Resource ARN would look like:
arn:aws:s3:::{BucketName}/{ObjectName}
Replace the bucket name to test-aws-01 and change ObjectName to *
Principal should be replaced by *
10. Save changes. The final bucket policy look like as follows:
11. In order to get object url of index.html go to bucket > look for index.html. The. properties will have object url copy it and paste to browser.
12. Your website got live !