Host a Static Website on AWS | AWS Developer Center

To begin this tutorial, you’ll need to create and initialize a repository. The easiest way to do this is by using the command create-react-app. Install this package using the following command in your Command Prompt or Terminal.

Already have a repository to connect? Skip to step c below.

Want to deploy without connecting to a Git provider? Begin by

Begin by clicking here

npx create-react-app amplifyapp
cd amplifyapp
npm start

In this step, you will create a GitHub repository and commit your code to the repository. You will need a GitHub account to complete this step – if you do not have an account, sign up here.

a. Create a new GitHub repo for your app (link)

b. Initialize git and push the application to the new GitHub repo executing the following commands in your command line interface:

git init
git remote add origin [email protected]:username/reponame.git
git add .
git commit -m “initial commit”
git push origin master

c. To connect your repository, log in to the Amplify Console and choose Get Started at the top of the page then Get Started under Amplify Hosting.

amplify-getstarted

Connect your GitHub, Bitbucket, GitLab, or AWS CodeCommit repositories. You also have the option of manually uploading your build artifacts without connecting a Git repository (see Manual Deploys). After you authorize the Amplify Console, Amplify fetches an access token from the repository provider, but it doesn’t store the token on the AWS servers. Amplify accesses your repository using deploy keys installed in a specific repository only.

After you connect the repository service provider, choose a repository, and then choose a corresponding branch to build and deploy.