Terraform

Terraform Module Library

Reusable modules for EKS, RDS, and security groups with automated tests.

Terraform 1.7+TerratestEKSRDSOpen Source

A collection of production-ready Terraform modules covering the most common AWS workloads. Each module is independently versioned, documented with variable and output schemas, and tested using Terratest.

Updated 20 April 2026 Terraform

Tech Stack

Terraform~> 1.7
Terratest~> 0.46
Go1.22 (test runner)

Features

  • EKS module with managed node groups and IRSA
  • RDS module supporting Aurora, MySQL, and PostgreSQL
  • Security group module with named ingress/egress rules
  • Automated Terratest suite for all modules
  • Semantic versioning via GitLab tags and Terraform registry

Module Structure

Each module lives in its own directory under `modules/`. It exposes `variables.tf`, `outputs.tf`, and a `README.md` generated by `terraform-docs`. Modules reference each other via local paths in tests and via registry source in consuming code.

Testing

Terratest spins up real AWS resources in an isolated account, runs assertions (e.g. EKS API reachable, RDS endpoint resolvable), then destroys everything. Tests run in GitLab CI on merge requests with a 30-minute timeout.

Using a Module

Reference any module from the library: `module "vpc" { source = "git::https://gitlab.com/gabaltech/terraform-modules//modules/vpc?ref=v1.3.0" }`. Pin to a tag for reproducible builds.

File Structure

  • modules/
    • eks/
      • main.tf
      • variables.tf
      • outputs.tf
      • README.md
    • rds/
      • main.tf
      • variables.tf
      • outputs.tf
      • README.md
    • security-group/
      • main.tf
      • variables.tf
      • outputs.tf
  • test/
    • eks_test.go
    • rds_test.go
    • security_group_test.go
  • .gitlab-ci.yml
  • README.md
GitLab (coming soon)