Use the Raspberry Pi 4 for AWS development - Part 1, Installation

By: Morten Jensen, Aug 16 2020

Background

With the advent of the Raspberry Pi 4, Pi’s have sufficiently powerful in terms of both CPU and memory for AWS development. Furthermore, AWS has recently made significant headway in the ARM space with the release of Graviton-based EC2 and support for ARM 64-bit (aarch64) with the following services:

Currently, there’s no known way to run Amazon Linux 2 on a Raspberry Pi (but AMI’s will run on Graviton-based EC2 instances in AWS). It’s possible that this will change in the future.

In the meantime, this post details how to install Ubuntu 20.04 as the development environment to build software destined for AWS services.

So why choose Ubuntu over Raspberry Pi OS (aka. Raspbian)?

The Raspberry Pi 4 has ARM64 64-bit (aarch64) support. With the Pi 4 the additional memory options (4GB and 8GB) makes it highly relevant to use a 64-bit OS.

Ubuntu has distributions that can be installed on the Raspberry PI. This includes a 64-bit version of the OS for select 3 and 4 models.

Currently the Raspberry Pi OS 64-bit version has only been announced in Beta relatively recently.

On release, Ubuntu 20.04 was certified with full support on Raspberry Pi 4.

In other words, Ubuntu 20.04 is currently the only fully supported ARM64 64-bit OS.

Note that this post assumes that you have followed the Get started with Ubuntu 20.04 on Raspberry Pi 4 post, which describes how to set-up various development software.

Software

This section details software to install for AWS development purposes.

aws cli (v2)

The aws cli v2 is available for ARM64 - Installation instructions.

This is the short version of installation instructions:

curl -O 'https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip'

unzip awscli-exe-linux-aarch64.zip

sudo ./aws/install

aws sam cli

The aws sam cli can be installed using:

pip3 install --user aws-sam-cli

cfn-lint

The cfn-lint package is an excellent linter for AWS Cloudformation and can be installed with:

pip3 install --user cfn-lint

aws chalice

Chalice requires Python3 and installation instructions are included on the Get started with Ubuntu 20.04 on Raspberry Pi 4 page.

aws chalice is a framework that allows you to create Serverless Lambda applications easily.

To install chalice, first create a virtual environment for python in a suitable location and finally install with pip:

mkdir -p $HOME/dev/git/test-app
cd -p $HOME/dev/git/test-app
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install chalice

aws cdk (Cloud Development Kit)

The CDK requires node and installation instructions are included on the Get started with Ubuntu 20.04 on Raspberry Pi 4 page.

To install the CDK, run:

npm install -g aws-cdk

cdk --version
1.66.0 (build 459488d)