Skip to content

eashaankar/aws_mini_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploying a React App to AWS

🌐 Website

Prerequisites

  • An AWS account: You will need an AWS account to create and configure the necessary services.
  • Node.js and npm: Ensure that you have Node.js and npm installed on your machine to build and deploy the React app.

Installation

Step 1: Set up React App

  1. Create a new React app: Start by creating a new React app using the create-react-app command. Open your terminal and run the following command:
npx create-react-app <desired app name>
  1. Build the app: Navigate to the app directory using cd and build the app using npm run build. This will generate the optimized production build of your React app.

Step 2: Set up an S3 bucket

  1. Create an S3 bucket: Go to the AWS Management Console, search for S3, and create a new bucket with a unique name. Ensure that the bucket is configured to allow public access.
  2. Upload the app files: In the S3 bucket, upload all the files and folders from the build directory of your React app.

Step 3: Set up CloudFront

  1. Create a CloudFront distribution: Go to the AWS Management Console, search for CloudFront, and create a new distribution. Set the following configurations:
    1.1 Origin Domain Name: Select your S3 bucket from the dropdown.
    1.2 Viewer Protocol Policy: Redirect HTTP to HTTPS.
    1.3 Alternate Domain Names (CNAMEs): Enter your desired domain or subdomain (in this case awsminiproject.com).
    1.4 SSL Certificate: Choose "Custom SSL Certificate" and select the certificate from ACM that matches your domain.
  2. Update Route53 DNS records: If you haven't already done so, go to the AWS Management Console, search for Route53, and update your DNS records to point to your CloudFront distribution.

Step 4: Set up ACM (Amazon Certificate Manager)

  1. Request a certificate: Go to the AWS Management Console, search for ACM, and request a new certificate for your domain or subdomain. Follow the instructions to validate your ownership of the domain.
  2. Associate the certificate with CloudFront: Once the certificate is issued, go back to the CloudFront distribution created in Step 3 and select the newly issued certificate.

License

This code is released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors