Skip to main content

Recommended Tools

  • AWS CLI – The AWS CLI is a powerful tool that lets perform most of the actions that you can do via the AWS Console.
  • AWS Vault – AWS Vault is a slick tool that allows you to easily use different sets of AWS credentials to run commands (aws, terragrunt, packer, et cetera). Once you've gone beyond a single AWS account, a tool like AWS vault is immensely helpful.
  • Docker – Run applications in a container that contains everything needed to run the application without affecting the host environment.
  • Golang – Golang is an exciting language that has taken the DevOps / infrastructure world by storm. Terraform, Terragrunt, and Terratest are all written in Go.
  • Kubectl – If you need to control your Kubernetes cluster, kubectl is at the operational core.
  • Packer – Packer lets you build a variety of images, including AWS AMIs and Docker containers. Those images are defined via code for repeatability.
  • Terraform – Terraform's declarative nature describes your infrastructure as code. If you're using Gruntwork's products, you're using Terraform.
  • Terragrunt – Terragrunt is our layer on top of Terraform to enable a highly DRY code base.
  • tfenvtfenv is a set of bash scripts that provide a workflow for managing and using multiple versions of Terraform. It was inspired by similar tools rbenv for Ruby versions and pyenv for Python.
  • tgswitchtgswitch is a tool for managing and using multiple versions of Terragrunt. Written in golang, it offers similar features as tfenv, including managing the versions to use in a version file.

Installation

If you would like to run the tools natively on your computer, the links provided above give installation instructions. If you are a user of brew, then in many cases, a brew install <TOOL> will work.

Tools via Docker

You can use a docker container with all of the tooling built in. If you would prefer to not install all of the tooling locally, then this route is for you.

Save following to a Dockerfile:

Dockerfile
FROM ubuntu:latest

RUN apt-get update && \
apt-get install -y wget unzip curl git

# Install gruntwork-installer, which is the preferred method for installing Gruntwork binaries and modules
RUN curl -LsS https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/v0.0.38/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version v0.0.38 --no-sudo true

# Install fetch
ARG FETCH_VERSION=0.4.5
RUN gruntwork-install --repo "https://github.com/gruntwork-io/fetch" --binary-name "fetch" --tag v${FETCH_VERSION} --no-sudo true

# Packer
ARG PACKER_VERSION=1.8.2
RUN wget -q https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip && unzip packer_${PACKER_VERSION}_linux_amd64.zip && mv packer /usr/local/bin
# Terraform
ARG TERRAFORM_VERSION=1.2.4
RUN wget -q https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip && mv terraform /usr/local/bin

# Terragrunt
ARG TERRAGRUNT_VERSION=0.38.4
RUN gruntwork-install --repo "https://github.com/gruntwork-io/terragrunt" --binary-name "terragrunt" --tag v${TERRAGRUNT_VERSION} --no-sudo true

# aws-vault
ARG AWS_VAULT_VERSION=6.6.0
RUN fetch --repo="https://github.com/99designs/aws-vault" --tag="v6.6.0" --release-asset="aws-vault-linux-amd64" /usr/local/bin/
RUN mv /usr/local/bin/aws-vault-linux-amd64 /usr/local/bin/aws-vault
RUN chmod +x /usr/local/bin/aws-vault

# AWS cli
RUN curl -s https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o aws_cli.zip && unzip aws_cli.zip && ./aws/install

# kubectl
ARG KUBECTL_VERSION=1.24.2
RUN curl -LO https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl
RUN install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# Golang
ARG GOLANG_VERSION=1.18.3
ARG GOPATH='/root/go'
RUN curl -L -s https://golang.org/dl/go${GOLANG_VERSION}.linux-amd64.tar.gz -o go.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go.tar.gz
RUN echo 'export PATH=$PATH:/usr/local/go/bin' >> /root/.profile
RUN echo 'export GOPATH=/root/go' >> /root/.profile

Build the container:

# Build the docker container named gruntwork
docker build . -t gruntwork

If you need to change the version of any of the binaries, you can pass those variables in as --build-arg parameters:

# Build the docker container with specific tool versions
docker build . --build-arg TERRAFORM_VERSION=1.0.2 --build-arg TERRAGRUNT_VERSION=0.31.0 -t gruntwork

Once the container has been built, you can run the container, mounting the current directory to /work:

# Run the container, mounting the current directory at /work
docker run -it -v $(pwd):/work gruntwork /bin/bash