🔥 Introduction
In cloud-native architectures, Amazon EKS (Elastic Kubernetes Service) is a powerful way to manage containerized applications at scale. When combined with AWS ALB (Application Load Balancer), it ensures seamless traffic management, automatic scaling, and security.

In this guide, I'll walk you through setting up an EKS cluster and deploying an ALB Ingress Controller using Terraform.

📌 Why Use ALB with EKS?
Amazon's Application Load Balancer (ALB) integrates well with Kubernetes to:
✅ Distribute traffic efficiently across multiple pods
✅ Enable SSL/TLS termination for security
✅ Support path-based & host-based routing
✅ Improve scalability with auto-healing features

🛠️ Tech Stack
Terraform – Infrastructure as Code
AWS EKS – Kubernetes Cluster
AWS ALB – Load Balancer
IAM Roles & Policies – Secure Access
Helm – Package Manager for Kubernetes

🚀 Step 1: Setting Up AWS EKS with Terraform
First, define the EKS cluster in Terraform:

resource "aws_eks_cluster" "eks" {
  name     = "my-eks-cluster"
  role_arn = aws_iam_role.eks_role.arn

  vpc_config {
    subnet_ids = [aws_subnet.public_1.id, aws_subnet.public_2.id]
  }
}

Create IAM Role for the ALB Controller:

resource "aws_iam_role" "alb_controller" {
  name = "alb-controller-role"
  assume_role_policy = jsonencode({
    Statement = [{
      Effect = "Allow"
      Principal = {
        Service = "eks.amazonaws.com"
      }
      Action = "sts:AssumeRole"
    }]
  })
}

🚀 Step 2: Deploy ALB Ingress Controller
Once EKS is up and running, install the ALB Ingress Controller using Helm:

helm repo add eks https://aws.github.io/eks-charts
helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
  --set clusterName=my-eks-cluster \
  --set serviceAccount.create=false \
  --set serviceAccount.name=alb-controller \
  -n kube-system

🚀 Step 3: Define Ingress Rules
Now, create an Ingress resource to route traffic via ALB:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
spec:
  rules:
  - host: my-app.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 80

Apply the changes:

kubectl apply -f ingress.yaml

✅ Verify Deployment
Check if the ALB is created:

kubectl get ingress -A

Head over to AWS Console → EC2 → Load Balancers and verify the ALB instance.

🎯 Conclusion
With Terraform and Helm, deploying EKS with ALB is now streamlined and automated. This setup ensures a highly scalable, secure, and manageable cloud-native architecture.

If you found this guide helpful, drop a comment or share your experience! 🚀