Sign inSign up

bgauduch/terraform-aws-cli

By bgauduch

•Updated 7 days ago

Minimal & lightweight docker image including AWS and Terraform CLI

Image
Developer tools
0

10K+

bgauduch/terraform-aws-cli repository overview

validate build-test push-edge release-please

dockerhub-description-update License Docker Pulls

Docker Pulls (legacy zenika)

⁠Terraform and AWS CLI Docker image

📦 New registry — please migrate. This image now lives at bgauduch/terraform-aws-cli⁠. The legacy zenika/terraform-aws-cli⁠ repository is frozen: update your docker pull / FROM references to the new one. Historical tags are being copied across, migration in progress — see #137⁠.

Available image tags can be found on the Docker Hub registry: bgauduch/terraform-aws-cli⁠

Supported versions are listed in the supported_versions.json⁠ file.

The following image tag strategy is applied:

TagWhat it points atMoves
bgauduch/terraform-aws-cli:latestthe newest release, with the latest versions in supported_versions.json⁠on every release
bgauduch/terraform-aws-cli:edgethe tip of master, same version selectionon every image change merged to master
bgauduch/terraform-aws-cli:vX.Ythe latest patch of that minor lineon every release of that line
bgauduch/terraform-aws-cli:vX.Y.Zthat release, with its latest Terraform and AWS CLI versionsnever
bgauduch/terraform-aws-cli:vX.Y.Z_tf-A.B.C_aws-D.E.Fthat release, fully pinned to a Terraform (A.B.C) and AWS CLI (D.E.F) combinationnever — pin this one for reproducibility

Which one to use: vX.Y.Z_tf-A.B.C_aws-D.E.F when a build must never change under you, latest or vX.Y for everyday use, edge only to try what is merged but not released.

Please report to the releases page⁠ for the changelogs.

Any other tags are not supported even if available.

Version support policy: supported Terraform versions follow upstream EOL — the latest three minor lines (the two HashiCorp still patches⁠ plus one kept as grace), one patch per line (see ADR-0015⁠). Retiring a version stops new builds only: every previously published fully-pinned tag (vX.Y.Z_tf-A.B.C_aws-D.E.F) is immutable and stays pullable forever — pin one of those to keep using an older combination.

Platform support policy: images are published for linux/amd64 and linux/arm64, the platforms AWS distributes a Linux CLI v2 bundle for (see ADR-0019⁠). As with versions, dropping a platform stops new builds only: tags published earlier keep the manifests they were pushed with.

⁠💡 Motivation

The goal is to create a minimalist and lightweight image with these tools in order to reduce network and storage impact.

This image gives you the flexibility to be used for development or as a base image as you see fits.

⁠🔧 What's inside ?

Tools included:

  • Terraform CLI⁠
  • AWS CLI⁠
  • Git⁠ for Terraform remote module usage
  • jq⁠ to process JSON returned by AWS
  • OpenSSH Client⁠ to handle Terraform module clone over SSH
  • This image uses a non-root user with a UID and GID of 1001 to conform with docker security best practices.

⁠🚀 Usage

⁠🐚 Launch the CLI

Set your AWS credentials (optional) and use the CLI as you would on any other platform, for instance using the latest image:

echo AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
echo AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
echo AWS_DEFAULT_REGION=YOUR_DEFAULT_REGION

docker container run -it --rm -e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" -e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" -e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" -v ${PWD}:/workspace bgauduch/terraform-aws-cli:latest

The --rm flag will completely destroy the container and its data on exit.

⁠⚙️ Build the image

The image can be built and verified locally with the validation script.

It will :

  • Run the structural checks on the repository;
  • Lint the Dockerfile with Hadolint⁠;
  • Build and tag the image bgauduch/terraform-aws-cli:dev for your platform;
  • Execute container structure tests⁠ on the image.
# build and verify with the latest supported versions
./scripts/validate.sh --full

Optionally, it is possible to choose the tools desired versions :

# Set tools desired versions
AWS_CLI_VERSION=2.12.6
TERRAFORM_VERSION=1.5.2

# build and verify these versions
./scripts/validate.sh --full $AWS_CLI_VERSION $TERRAFORM_VERSION

⁠🙏 Contributions

Before contributing, please read the contributing guide⁠, the code of conduct⁠ and the security policy⁠.

Do not hesitate to contribute by filling an issue⁠ or a PR⁠ !

⁠📚 Documentations

⁠🚩 Similar repositories

⁠📖 License

This project is under the Apache License 2.0⁠

with love by zenika

Tag summary

Content type

Image

Digest

sha256:527001646…

Size

167.4 MB

Last updated

7 days ago

docker pull bgauduch/terraform-aws-cli