Use HCL(Terraform) to create AWS EKS

Define main.tf
        
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 2.70"
    }
  }
}

    provider "aws" {
    region = "us-west-2"
    }
     
    
Define EKS Cluster
        
            resource "aws_eks_cluster" "my_cluster" {
    name     = "my-eks-cluster"
    role_arn = aws_iam_role.eks_cluster.arn
    vpc_config {
    subnet_ids = ["subnet-abc123", "subnet-def456"]  # Replace with your desired subnet IDs
    }
    }

        
    
Define IAM role policies and permissions
        
    resource "aws_iam_role" "eks_cluster" {
    name = "my-eks-cluster-role"

    }
        
    
Config kube with cluster
        
   aws eks --region us-west-2 update-kubeconfig --name my-eks-cluster
        
    
Terraform Code
        
    terraform init
    terraform apply
        
    


Let's work together...

Would you like a cup of coffee?