Terraform
Progress checklist
All infrastructure in this walkthrough — VPC, subnets, EKS
Elastic Kubernetes Service — AWS-managed Kubernetes control plane; you manage nodes and workloads, AWS runs the API server, etcd, and scheduler. cluster, node groups, IAM
Identity and Access Management — the AWS service that controls permissions and roles for all resources. roles — is created and destroyed with Terraform
Terraform — the infrastructure-as-code tool used to create and manage all AWS resources in this walkthrough. . Nothing is created manually in the console (except one-off checks). Using Terraform means:
- Every change is reviewed before it’s applied
- The full environment can be torn down with one command (
terraform destroy) - State tracks what’s been created so incremental updates are safe
The Terraform code lives in a separate repository (aws-eks-terraform). You’ll clone it in the Git step.
-
Install Terraform. Required
Use Terraform 1.5 or later. The walkthrough uses features from 1.5+.
Install via Homebrew (HashiCorp tap) brew tap hashicorp/tapbrew install hashicorp/tap/terraformTo upgrade later:
Terminal window brew upgrade hashicorp/tap/terraformAdd the HashiCorp APT repository and install. If needed, install dependencies first:
curl,gnupg,software-properties-common.Add HashiCorp repo (Debian/Ubuntu) sudo apt updatesudo apt install -y curl gnupg software-properties-commoncurl -fsSL https://apt.releases.hashicorp.com/gpg \| sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpgecho "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \https://apt.releases.hashicorp.com $(lsb_release -cs) main" \| sudo tee /etc/apt/sources.list.d/hashicorp.listsudo apt updatesudo apt install -y terraformAdd the HashiCorp repository and install. If needed, install
curlandgnupg2first (e.g.sudo dnf install -y curl gnupg2).Add HashiCorp repo (RHEL/Fedora) sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.reposudo dnf install -y terraform -
Verify the installation.
Terminal window terraform versionExpected output:
Terraform v1.x.xon linux_amd64The version must be 1.5 or higher. If you have an older version installed via a different method, uninstall it first.
-
Create a workspace directory.
Create a dedicated directory where you’ll clone and run Terraform. This keeps the walkthrough files separate from other projects.
Terminal window mkdir -p ~/workspacecd ~/workspaceYou’ll clone the Terraform repo into this directory in the Git step.
-
Understand the state setup.
Next step
Section titled “Next step”Continue to kubectl to install the Kubernetes CLI.