In this article, we will look into steps to create an AWS CI/CD pipeline to deploy a static react app on AWS S3 using the AWS Cloudformation Template. We will use AWS Codecommit as a source code repository and AWS Codebuild to build the code.

Image for post

React App

We can simply create a react app using create-react-app command in terminal.

npx create-react-app <app_name>

After creating an app, use these commands to open the react app in your browser to check if the app is working or not.

cd <your_app_name>
npm start

I prefer using visual studio code and it’s terminal. You can use any other as per your convenience.

Image for post

VS Code Terminal & React App Files

Pushing Code to CodeCommit

Now we will create a repository on CodeCommit. We will navigate to Codecommit from the management console and create a new repository.
Image for post

Image for post

After creation clone your repo to your local system or either upload the files and commit them.

You can Copy paste these files from your react app folder, commit and push it to your code commit repository. You should have the following files

#cicd-pipeline #aws-cloudformation #aws #devops #react

React website AWS CI/CD Pipeline with Cloudformation Template
12.40 GEEK