Skip to content

Provision an EKS cluster via Terraform (AWS)

Prerequisites

This tutorial assumes a basic understanding of Kubernetes and kubectl, but no prior deployment experience is required.

You can follow the tutorial using either Terraform Community Edition or HCP Terraform. HCP Terraform is a platform designed to help manage and execute Terraform projects, offering features such as remote state management, remote execution, structured plan output, and workspace resource summaries.

To proceed with Terraform Community Edition, simply select the corresponding tab to complete the tutorial using that version.

Open Ubuntu session (can be done on Windows store getting the application Ubuntu 22.04.3 LTS with Windows Subsystem Linux)

$ git clone https://github.com/hashicorp/learn-terraform-provision-eks-cluster

cd learn-terraform-provision-eks-cluster

ahouab@FR-TWFR-VzUTZcJ:~/projects/Provision an EKS cluster (AWS)/learn-terraform-provision-eks-cluster$ terraform init
Initializing the backend…
Initializing modules…
Downloading registry.terraform.io/terraform-aws-modules/eks/aws 20.8.5 for eks…

  • eks in .terraform/modules/eks
  • eks.eks_managed_node_group in .terraform/modules/eks/modules/eks-managed-node-group
  • eks.eks_managed_node_group.user_data in .terraform/modules/eks/modules/_user_data
  • eks.fargate_profile in .terraform/modules/eks/modules/fargate-profile
    Downloading registry.terraform.io/terraform-aws-modules/kms/aws 2.1.0 for eks.kms…
  • eks.kms in .terraform/modules/eks.kms
  • eks.self_managed_node_group in .terraform/modules/eks/modules/self-managed-node-group
  • eks.self_managed_node_group.user_data in .terraform/modules/eks/modules/_user_data
    Downloading registry.terraform.io/terraform-aws-modules/iam/aws 5.39.0 for irsa-ebs-csi…
  • irsa-ebs-csi in .terraform/modules/irsa-ebs-csi/modules/iam-assumable-role-with-oidc
    Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 5.8.1 for vpc…
  • vpc in .terraform/modules/vpc
    Initializing provider plugins…
  • Reusing previous version of hashicorp/random from the dependency lock file
  • Reusing previous version of hashicorp/time from the dependency lock file
  • Reusing previous version of hashicorp/null from the dependency lock file
  • Reusing previous version of hashicorp/tls from the dependency lock file
  • Reusing previous version of hashicorp/cloudinit from the dependency lock file
  • Reusing previous version of hashicorp/aws from the dependency lock file
  • Installing hashicorp/tls v4.0.5…
  • Installed hashicorp/tls v4.0.5 (signed by HashiCorp)
  • Installing hashicorp/cloudinit v2.3.4…
  • Installed hashicorp/cloudinit v2.3.4 (signed by HashiCorp)
  • Installing hashicorp/aws v5.47.0…
  • Installed hashicorp/aws v5.47.0 (signed by HashiCorp)
  • Installing hashicorp/random v3.6.1…
  • Installed hashicorp/random v3.6.1 (signed by HashiCorp)
  • Installing hashicorp/time v0.11.1…
  • Installed hashicorp/time v0.11.1 (signed by HashiCorp)
  • Installing hashicorp/null v3.2.2…
  • Installed hashicorp/null v3.2.2 (signed by HashiCorp)
    Terraform has made some changes to the provider dependency selections recorded
    in the .terraform.lock.hcl file. Review those changes and commit them to your
    version control system if they represent changes you intended to make.

Terraform has been successfully initialized!