The objective with this is to get a react app build, tested and stored its artifact by using AWS awesome services. For the purpose of this document i'm going to accomplish the following:

  • Install npm dependencies
  • Test app
  • Build artifact
  • Store Artifact (.zip) in S3 (overwrite if build happens multiple times)

AWS Code Commit

As a AWS fan, i'm going to use CodeCommit just to host my code. So the first thing i do is, to make sure that you can clone the repo. I created my SSH keys by doing the following:

ssh-keygen -t rsa -b 4096 -C ""

called my ssh keys aws-awesomeness. Next i went to IAM > users > {my-user} > Security Credentials and clicked the "Upload SSH Public Key" and pasted the value in the Once you save it, it will generate an {SSH-KEY} that you will need when when you update the ~/.ssh/config file with the following content:

Host git-codecommit.*
  User {SSH-KEY}
  IdentityFile ~/.ssh/keys/aws-awesomeness

Once you go to Code Commit and create a repo, clone it in your local:

git clone ssh://{}

and you should be able to move forward to building your react app (make sure you write tests for it).


I'm going to have a bucket where i'm going to place all my react apps. For the sake of this and i will call it react-apps (it's already taken).

Code Build

Now i want to be able to build .zip artifacts that i will store in my react-apps bucket so i will now go to Code Build and create the "Create Project" button. I'm going to call this project same as the repo with the build sufix (

  • Project Name: repo-name-com-build
  • Source provide: AWS CodeCommit
  • Repository:
  • Environment image: Use an image managed by AWS CodeBuild
  • Operative System: Ubuntu
  • Runtime: Node.js
  • Version: aws/codebuild/nodejs:6.3.1
  • Build specification: Insert build commands
  • Build Command: npm install && npm test && npm run build
  • Artifacts Type: Amason S3
  • Name:
  • Namespace type: None
  • Bucket Name: react-apps
  • output files: build/**/*
  • Service Role:

If you decide to have a file in your repo to configure the build it would look like this:

version: 0.2

      - npm install
      - npm run ci-test
      - npm run build

    - 'build/**/*'

Click Continue, review and hit "save and build". It should take you to a page where it asks you for the branch. Select master (for this first build) and the hit continue. If everything went well, at the end of the process, you should be able to go to the