Install Pre-Requisites

Install Pre-Requisites

In your Cloud9 environment, run the following commands to install the pre-requisites (this may take a few minutes):

# Expand hard drive
curl -O https://jah-imm-day.s3.amazonaws.com/c9/resize.sh
sh resize.sh 30

Next, install some updates for python

# install latest Python (3.8)
sudo amazon-linux-extras enable python3.8
sudo yum -y install python3.8

# install 3.8 as the default
sudo alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 10

# install latest pipenv
sudo pip3 install pipenv

# Update the AWS CLI
pip install --user --upgrade awscli

Install the Amplify CLI - this is our toolchain for working with AWS services.

# Install the AWS Amplify CLI
npm install -g @aws-amplify/cli

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

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