Install Pre-Requisites

Install Pre-Requisites

1.

In your Cloud9 environment, run the following commands to install the pre-requisites:

# Update pip
sudo pip install --upgrade pip
# Update NPM
npm install -g npm
# Update the AWS CLI
pip install --user --upgrade awscli
# Install the AWS Amplify CLI
npm install -g @aws-amplify/cli
# Install create-react-app
npm -g i create-react-app

These commands will take a few minutes to complete. You may receive some warnings and error messages, that is typically ok

2.

Next, you must create the file ~/.aws/config file. This step will allow us to use the AWS default credentials that are included as a profile on the Cloud9 instance. You can do this by running this block of code in your Cloud9 terminal.

# Set Region Variable
region=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F\" '{print $4}')
# create default config file
cat <<END > ~/.aws/config
[default]
region=${region}
END