Sign inSign up

ops4life/terraform-toolkit

By ops4life

β€’Updated about 2 hours ago

The collection of essential tools for Terraform projects

Buildkit cache
Image
Developer tools
0

7.8K

ops4life/terraform-toolkit repository overview

β πŸ› οΈ Terraform Toolkit Docker Image

CI Build Test

This repository provides a Docker image for a comprehensive Terraform toolkit. It bundles essential Terraform-related tools such as Terraform, Terragrunt, Checkov, TFDoc, TFLint, and Trivy to streamline infrastructure management, security checks, and linting.

⁠🧰 Tools Included

The Docker image includes the following tools:

  • 🌍 Terraform⁠: Infrastructure as Code (IaC) tool to manage cloud and on-prem resources.
  • 🚜 Terragrunt⁠: A thin wrapper for Terraform that provides extra tools for keeping your configurations DRY.
  • πŸ” Checkov⁠: Static code analysis tool for infrastructure-as-code to detect cloud misconfigurations.
  • πŸ“„ terraform-docs⁠: Generate documentation for your Terraform modules in various output formats.
  • πŸ”§ TFLint⁠: A linter for Terraform code to detect potential errors and enforce best practices.
  • πŸ›‘οΈ Trivy⁠: Comprehensive security scanner for containers and Terraform configurations (replaces deprecated TFSec).

β πŸš€ Getting Started

β βœ… Prerequisites

Make sure you have Docker installed on your system before using this image.

⁠Install Docker

πŸ“₯ Pulling the Docker Image

The image repository: terraform-toolkit⁠ πŸ“¦

To pull the pre-built Docker image from Docker Hub:

docker pull ops4life/terraform-toolkit:latest
β πŸƒ Usage

To run the container:

docker run -it ops4life/terraform-toolkit:latest

You can then use the following tools from within the container:

  • terraform
  • terragrunt
  • checkov
  • terraform-docs
  • tflint
  • trivy
  • eksctl
  • pre-commit
β πŸ’‘ Example

Run Terraform commands inside the container:

docker run -v $(pwd):/workspace -w /workspace ops4life/terraform-toolkit:latest terraform init

This command mounts your current working directory (pwd) into the container’s /workspace directory and runs terraform init.

β βš™οΈ Continuous Integration / Continuous Delivery

This repository includes several GitHub Actions workflows to automate testing, dependency updates, and release processes.

  • πŸ”¨ Build and Test: The build-tf-toolkit-image.yaml workflow builds and tests the Docker image automatically.
  • πŸ§ͺ Image Testing: The test-image.yaml workflow runs comprehensive tests on all tools in the image.
  • πŸ”„ Dependency Checks: The check-tool-updates.yaml and deps-review.yaml workflows handle automatic updates and reviews of dependencies.
  • πŸ“¦ Release Automation: The release.yaml workflow automates creating new releases with semantic versioning.
  • πŸ” Pre-commit Checks: The pre-commit-auto-update.yaml ensures that pre-commit hooks and lints are consistently maintained.

For detailed information about CI/CD workflows, see .github/workflows/README.md⁠.

⁠πŸ§ͺ Testing

This repository includes a comprehensive test suite to validate all tools in the Docker image.

⁠Quick Start
# Navigate to test directory
cd test

# Test all tool versions
make test-versions

# Run full test suite
make test

# Run Terraform workflow
make init validate plan

# Run security scans
make security
⁠Test Coverage
  • βœ… Tool Versions - Verify all 9 tools are installed and accessible
  • βœ… Terraform Workflow - Test init, validate, fmt, plan, apply, destroy
  • βœ… Code Quality - TFLint checks and formatting validation
  • βœ… Security Scanning - Checkov and Trivy scans (Trivy replaces deprecated TFSec)
  • βœ… Documentation - terraform-docs generation
  • βœ… Terragrunt - Terragrunt workflow testing

For detailed testing instructions, see:

β πŸ—‚οΈ Project Structure
β”œβ”€β”€ .editorconfig                 # Editor configuration for consistent coding styles
β”œβ”€β”€ .github/                      # GitHub workflows for CI/CD automation
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/           # Templates for GitHub issues
β”‚   β”œβ”€β”€ workflows/                # CI/CD pipelines (build, test, release)
β”‚   β”‚   β”œβ”€β”€ build-tf-toolkit-image.yaml  # Multi-arch Docker build
β”‚   β”‚   β”œβ”€β”€ test-image.yaml       # Image testing workflow
β”‚   β”‚   β”œβ”€β”€ release.yaml          # Semantic release automation
β”‚   β”‚   └── README.md             # Workflow documentation
β”‚   β”œβ”€β”€ dependabot.yml            # Automatic dependency updates
β”‚   └── pull_request_template.md  # Template for pull requests
β”œβ”€β”€ .gitignore                    # Files and directories to ignore in Git
β”œβ”€β”€ .pre-commit-config.yaml       # Pre-commit hooks configuration
β”œβ”€β”€ .vscode/extensions.json       # Recommended extensions for VSCode users
β”œβ”€β”€ CODEOWNERS                    # File to manage repository code owners
β”œβ”€β”€ Dockerfile                    # Dockerfile to build the image with the tools
β”œβ”€β”€ LICENSE                       # License for the project
β”œβ”€β”€ README.md                     # Documentation (you're reading this!)
β”œβ”€β”€ TEST_GUIDE.md                 # Comprehensive testing guide
└── test/                         # Test suite for Docker image
    β”œβ”€β”€ main.tf                   # Sample Terraform configuration
    β”œβ”€β”€ variables.tf              # Variable definitions
    β”œβ”€β”€ terragrunt.hcl           # Terragrunt configuration
    β”œβ”€β”€ Makefile                  # Test automation commands
    β”œβ”€β”€ test-toolkit.sh          # Comprehensive test script
    └── README.md                 # Test documentation
⁠🀝 Contributing

We welcome contributions! To get started:

  • 🍴 Fork the repository.
  • πŸ› οΈ Create a new branch for your feature or bug fix.
  • πŸ“₯ Submit a pull request when your changes are ready. Please make sure to follow our coding style guidelines and ensure all tests pass.
β πŸ“„ License

This project is licensed under the terms of the MIT License⁠.

Tag summary

Content type

Image

Digest

sha256:c31004e9a…

Size

368.1 MB

Last updated

about 2 hours ago

docker pull ops4life/terraform-toolkit