This post is a set of notes on the steps to build and deploy a React project using AWS Amplify.
Steps
Initial Amplify Setup
Install the Amplify cli.
npm install -g @aws-amplify/cliNext, configure your AWS cli credentials. This requires creating an IAM user and granting permissions in the console beforehand.
amplify configureInitializing the Amplify Project
Move into your existing React project directory and run the following commands.
cd your-react-project
amplify initYou'll be asked a series of questions interactively — just answer them one by one.
Adding an API
amplify add apiAdd the necessary packages like this.
Pushing the Changes
Once everything is done, push it.
amplify pushDeployment
There are two ways to deploy: one is to keep using the CLI as-is, and the other is to deploy through the web using the AWS Amplify console.
First, here's the CLI method.
amplify add hosting
amplify publishThat's all you need.
For the other option — deploying via the web — go to the amplify console and connect your GitHub repository to deploy.
Reference
Here's a link to the video I used as a reference.
