Hi,
We have been using Terraform EKS module and trying to parametrize ‘eks_managed_node_groups’ values based on the development and production environment as we have the same code base. We have used file() and variable approaches but both resulted in the error.
varibales.tf
variable "eks_cluster_nodegroups" {
description = "Nodegroups of the EKS cluster"
}
.tfvars
eks_cluster_nodegroups = <<EOF
{
ng-1 = {
min_size = 1
max_size = 2
desired_size = 1
instance_types = ['t3.small']
capacity_type = 'SPOT' //ON_DEMAND
}
}
EOF
eks.tf
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "~> 18.0"
.....
.....
eks_managed_node_groups = var.eks_cluster_nodegroups
.....
}
Does anyone know how to fix this issue?
Thank you.
EKS module: Terraform Registry
