SERVERLESS RUBY
Build and Deploy AWS Lambda Functions from Scratch

Interlude: Installing Terraform

INTERLUDE: Installing Terraform

Terraform will handle our infrastructure-as-code setup, from S3 buckets to Lambda permissions.

On macOS (via Homebrew)

brew tap hashicorp/tap
brew install hashicorp/tap/terraform

On Ubuntu/Debian

sudo apt-get update && \
  sudo apt-get install -y gnupg software-properties-common curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list

sudo apt update && sudo apt install terraform

Verify Installation

terraform -v

Should output something like:

Terraform v1.x.x

You're now ready to build your infrastructure with code!

INTERLUDE: Installing Terraform