DEV Community

Cover image for Create Amazon EKS Cluster using Terraform Module
8

Create Amazon EKS Cluster using Terraform Module

Terraform has community supported modules for creating Infrastructure in various Public Cloud Providers.
AWS community has extensively worked on creating useful modules. So if anyone wants to create Infrastructure in AWS they can search for modules in terraform-aws-modules in GitHub to create the Infrastructure.

Amazon EKS Terraform Module

One of the most used services in AWS Cloud is Amazon Elastic Kubernetes Service (Amazon EKS) and we can make use of the Terraform AWS EKS module to create EKS Cluster.

This module comes up with required Infra configuration for and does not need much tweak to create the EKS Cluster.

eks tf module

How to create Cluster

Using this module we can start the EKS Cluster creation in just 3 steps.
For example: Here are the simple steps to create EKS Cluster with self managed nodes

  • Step 1: Clone the Terraform EKS repo from here
  • Step 2: Go to examples/self_managed_node_group
  • Step 3: Run below terraform commands to create EKS Cluster in AWS Cloud
terraform init
terraform plan
terraform apply
Enter fullscreen mode Exit fullscreen mode

Follow the similar steps to create EKS Cluster of type EKS managed node group. The example code available in the directory examples/eks_managed_node_group

Start using the Cluster

Once the terraform apply is completed successfully, it will show a set of terraform output values containing the details of the newly created cluster.

Run the below command to update the users kubeconfig file to start using the cluster

aws eks update-kubeconfig --name ex-self-managed-node-group
Enter fullscreen mode Exit fullscreen mode

This command will update the details Cluster context and user sections in ~/.kube/config file.

In the next blog, we will see how to start using the Cluster and what are all the components created as part of Amazon EKS Cluster Terraform Code.

Things to note

User needs to have,

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post