NotHarshhaa
eks-cluster-terraform
HCL

This project uses Terraform to provision an Amazon EKS Cluster on AWS. By leveraging Infrastructure as Code (IaC), we automate the deployment of Kubernetes clusters with modular and reusable Terraform configurations.

Last updated May 25, 2026
73
Stars
67
Forks
0
Issues
0
Stars/day
Attention Score
32
Language breakdown
No language data available.
โ–ธ Files click to expand
README

๐Ÿš€ Deploy an EKS Cluster with Terraform โ€“ Like a Boss!

banner


๐Ÿ“Œ Project Overview

EKS Cluster Deployment

This project uses Terraform to provision an Amazon EKS Cluster on AWS. By leveraging Infrastructure as Code (IaC), we automate the deployment of Kubernetes clusters with modular and reusable Terraform configurations.

๐Ÿ”น Kubernetes (K8s) manages containerized applications efficiently. ๐Ÿ”น EKS (Elastic Kubernetes Service) is a managed K8s solution on AWS. ๐Ÿ”น Terraform simplifies infrastructure provisioning with reusable modules.

With this setup, you can deploy, manage, and scale Kubernetes workloads seamlessly!


๐Ÿ“ Project Structure

The repository follows a modular structure for better organization and reusability:

EKS-CLUSTER-TERRAFORM/
โ”‚โ”€โ”€ modules/                   # Terraform modules  
โ”‚   โ”œโ”€โ”€ eks/                   # EKS module  
โ”‚   โ”‚   โ”œโ”€โ”€ main.tf            # Defines EKS cluster  
โ”‚   โ”‚   โ”œโ”€โ”€ outputs.tf         # Outputs for EKS cluster  
โ”‚   โ”‚   โ”œโ”€โ”€ variables.tf       # Variables for EKS cluster  
โ”‚   โ”œโ”€โ”€ vpc/                   # VPC module  
โ”‚   โ”‚   โ”œโ”€โ”€ main.tf            # Defines networking resources  
โ”‚   โ”‚   โ”œโ”€โ”€ outputs.tf         # Outputs for VPC  
โ”‚   โ”‚   โ”œโ”€โ”€ variables.tf       # Variables for VPC  
โ”‚  
โ”‚โ”€โ”€ .gitignore                 # Git ignore file  
โ”‚โ”€โ”€ LICENSE                    # License file  
โ”‚โ”€โ”€ kubectl.sha256             # Checksum for kubectl  
โ”‚โ”€โ”€ .terraform.lock.hcl         # Terraform lock file  
โ”‚โ”€โ”€ kubernetes.tf              # Kubernetes resources definition  
โ”‚โ”€โ”€ main.tf                    # Root Terraform configuration  
โ”‚โ”€โ”€ outputs.tf                 # Root outputs  
โ”‚โ”€โ”€ provider.tf                 # Provider configurations  
โ”‚โ”€โ”€ README.md                   # Documentation (this file)

๐Ÿ”น modules/eks โ€“ Manages EKS cluster deployment. ๐Ÿ”น modules/vpc โ€“ Handles VPC and networking setup. ๐Ÿ”น provider.tf โ€“ Defines the AWS provider. ๐Ÿ”น main.tf โ€“ Root Terraform script to call modules. ๐Ÿ”น outputs.tf โ€“ Stores and displays useful deployment details.


๐ŸŽฏ Why Terraform for EKS?

Using Terraform for EKS offers several advantages over manual provisioning:

โœ” Automated & Repeatable Deployments โ€“ Reduce human error. โœ” Infrastructure as Code (IaC) โ€“ Easily track changes. โœ” Dependency Awareness โ€“ Ensures resources are created in the correct order. โœ” Scalability & Reusability โ€“ Modular design for better maintainability.


โšก Prerequisites

Before you begin, ensure you have the following installed:

โœ… AWS Account โ€“ Sign up at AWS if you donโ€™t have one. โœ… Terraform โ€“ Install from Terraform's official site. โœ… AWS CLI โ€“ Install and configure credentials (guide). โœ… kubectl โ€“ Kubernetes CLI tool (installation guide). โœ… VS Code (Optional) โ€“ Recommended IDE for managing Terraform code.


๐Ÿš€ Deployment Steps

1๏ธโƒฃ Clone the Repository

git clone https://github.com/NotHarshhaa/eks-cluster-terraform
cd eks-cluster-terraform

2๏ธโƒฃ Initialize, Plan & Apply Terraform

Run the following Terraform commands:

terraform init      # Initialize Terraform backend  
terraform plan      # Preview infrastructure changes  
terraform apply     # Deploy infrastructure

๐Ÿ“Œ Expected Outputs:

  • EKS Cluster Name
  • Node IP Addresses
  • VPC ID

3๏ธโƒฃ Connect to Your EKS Cluster

After deployment, retrieve cluster credentials:

aws eks update-kubeconfig --name <EKSCLUSTERNAME> --region <AWS_REGION>

Verify cluster connectivity:

kubectl get nodes

4๏ธโƒฃ Terraform Cloud Integration (Optional)

If you want to integrate with Terraform Cloud:

1๏ธโƒฃ Go to Terraform Cloud 2๏ธโƒฃ Create a new Workspace and connect your GitHub repository. 3๏ธโƒฃ Add the following environment variables:

AWSACCESSKEY_ID
AWSSECRETACCESS_KEY
AWSDEFAULTREGION
CONFIRM_DESTROY

4๏ธโƒฃ Run the Terraform plan & apply in Terraform Cloud.


5๏ธโƒฃ Destroy the Infrastructure

To delete the deployed resources, run:

terraform destroy

Alternatively, if using Terraform Cloud, go to: Settings โ†’ Destruction & Deletion โ†’ Queue destroy plan.


๐ŸŽ‰ Congratulations! You've Successfully Deployed an EKS Cluster with Terraform!

Success


โญ Hit the Star!

If you find this repository helpful and plan to use it for learning, please consider giving it a star โญ. Your support motivates me to keep improving and adding more valuable content! ๐Ÿš€


๐Ÿ› ๏ธ Author & Community

This project is crafted with passion by Harshhaa ๐Ÿ’ก.

Iโ€™d love to hear your feedback! Feel free to open an issue, suggest improvements, or just drop by for a discussion. Letโ€™s build a strong DevOps community together!


๐Ÿ“ง Let's Connect!

Stay connected and explore more DevOps content with me:

LinkedIn GitHub Telegram Dev.to Hashnode


๐Ÿ“ข Stay Updated!

Want to stay up to date with the latest DevOps trends, best practices, and project updates? Follow me on my blogs and social channels!

Follow Me

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท NotHarshhaa/eks-cluster-terraform ยท Updated daily from GitHub