This repository contains reusable Terraform modules for provisioning cloud infrastructure. These modules follow best practices for modularization and can be used across multiple projects.
.
├── README.md
├── external-secret.yaml
├── modules
│ ├── api-gateways
│ │ ├── main.tf
│ │ └── variables.tf
│ ├── cognito
│ │ ├── main.tf
│ │ └── variables.tf
│ ├── eks
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── iam
│ │ ├── main.tf
│ │ └── outputs.tf
│ ├── s3
│ │ ├── main.tf
│ │ └── variables.tf
│ ├── security-group
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── vault
│ │ ├── install.sh
│ │ ├── main.tf
│ │ └── variables.tf
│ └── vpc
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
└── secret-store.yaml
10 directories, 23 files
Each module can be used independently in your Terraform configurations. These modules should be sourced from this repository into another Terraform project.
In your separate Terraform repository:
module "eks" {
source = "git::https://github.com/your-org/terraform-modules.git//modules/eks?ref=main"
cluster_name = "my-eks-cluster"
subnet_ids = ["subnet-abc", "subnet-def"]
}module "vpc" {
source = "git::https://github.com/your-org/terraform-modules.git//modules/vpc?ref=main"
vpc_name = "my-vpc"
cidr_block = "10.0.0.0/16"
}- Keep modules small and focused – each module should serve a single purpose.
- Use versioning – tag releases to ensure stability.
- Follow Terraform best practices – maintain proper
variables.tf,outputs.tf, and documentation. - Lint and validate – use
terraform fmt,terraform validate, andtflintto maintain code quality.
This repository is configured to run Terraform linting and validation using GitHub Actions.
Before pushing changes, run:
terraform fmt -recursive
terraform validate
terraform plan- Fork the repository and create a new branch.
- Make changes and test them.
- Open a pull request with a detailed description.
NA