SAM CLI

AWS Cloud9 comes with SAM CLI installed. Let’s verify it, and upgrade it as needed.

  1. Run sam --version. You will most likely see something like 1.31.0.

NOTE: ONLY follow this section if you have an older version and you want to upgrade.

  1. Run the following command to install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Enter Control+D to install in the /home/ec2-user/.linuxbrew directory.
  2. Enter Return key to continue
  3. Run the following commands to add Homebrew into your path
echo 'eval "$(/home/ec2-user/.linuxbrew/bin/brew shellenv)"' >> /home/ec2-user/.bash_profile
eval "$(/home/ec2-user/.linuxbrew/bin/brew shellenv)"
  1. Run the following commands to install the latest SAM CLI
brew tap aws/tap
brew install aws-sam-cli
  1. Verify version
sam --version