
Terraform Module Library
Reusable modules for EKS, RDS, and security groups with automated tests.
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.
Tech Stack
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
- eks/
- test/
- eks_test.go
- rds_test.go
- security_group_test.go
- .gitlab-ci.yml
- README.md