Skip to the content.

Terraform

This repo is inspired by Amazon EKS Blueprints for Terraform.

This project includes the following components:

Prerequisites

Setup cluster

Run the following command to set up the cluster

export environment=dev
# Initialize Terraform workspace
terraform init -backend-config=environments/${environment}/backend.tf
# Review the planned actions before continuing
terraform apply --var-file=environments/${environment}/${environment}.tfvars
# Configure kubectl
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)

Destroy cluster

terraform apply -destroy -var-file=environments/${environment}/${environment}.tfvars

Fix this error

Doc for enabling this add-on is on this page:https://aws-ia.github.io/terraform-aws-eks-blueprints/v4.21.0/add-ons/kube-state-metrics/. It appears that this particular add-on is currently disabled and the blueprint docs have yet to be (annoyingly) corrected. Here is the closed issue: https://github.com/aws-ia/terraform-aws-eks-blueprints/issues/464#issuecomment-1107485356

Error: Unsupported argument
 on kubernetes_addons.tf line 23, in module "eks_blueprints_kubernetes_addons":
 23:   enable_kube_state_metrics           = true
 An argument named "enable_kube_state_metrics" is not expected here.

References