How amanpathak-devops/eks-terraform-github-actions works
Project Type and Purpose
• This is an Infrastructure-as-Code (IaC) project that uses Terraform to provision AWS EKS clusters and GitHub Actions (plus an optional Jenkins pipeline) to automate plan/apply operations.
• The goal is to provision “production-ready” EKS clusters, complete with VPC, IAM roles, and supporting services, all orchestrated through GitHub workflows (and optionally Jenkins).
File Structure
Top-level components:
• .github/workflows/terraform.yml → GitHub Actions CI workflow
• Jenkinsfile → Jenkins pipeline alternative
• eks/ → Terraform code for a specific environment (dev)
– backend.tf (remote state config)
– main.tf (EKS cluster resource definitions)
– variables.tf + dev.tfvars
• module/ → reusable Terraform modules
– vpc.tf (VPC, subnets, routing)
– iam.tf (IAM roles, policies)
– eks.tf (EKS cluster, node groups)
– gather.tf (data sources or “gather” patterns)
– variables.tf
• assets/ → presentation GIF
README Insights
• Confirms use of Terraform + GitHub Actions for EKS provisioning.
• Mentions Infrastructure as Code and CI/CD automation.
Main Components & Relationships
a. CI/CD Layer
• Developers push Terraform code to GitHub
• GitHub Actions workflow triggers on push/PR
• (Optionally) Jenkins pipeline can run terraform plan/apply
b. Terraform Orchestration
• Runs terraform init against remote backend (S3 + DynamoDB)
• Executes terraform plan and terraform apply
• Loads modules from module/ folder
c. AWS Infrastructure
• VPC Module: Creates VPC, subnets (public/private), route tables
• IAM Module: Defines IAM roles, policies for EKS + nodes
• EKS Module: Provisions EKS control plane, node groups
• Gather Module: Pulls in data sources (e.g., existing subnets, AMIs)
d. State Management
• Terraform backend (S3 bucket + DynamoDB) ensures state locking & versioning
e. External Services
• AWS EKS, S3, DynamoDB
• GitHub Actions
• (Optional) Jenkins + its agents
Architectural Patterns & Principles
• Modular Terraform: separation of concerns via modules (VPC, IAM, EKS)
• Remote State Management: backend.tf for state storage and locking
• CI/CD as Code: workflows declaratively defined in YAML
• Environment Isolation: dev.tfvars allows environment-specific overrides