I am using terraform-aws-eks module to deploy EKS clusters. I was hoping for some help turning node_groups map of maps into a variable so that I can modify a variables file for different environments. Here is the Map of Maps:
node_groups = {
example = {
desired_capacity = 1
max_capacity = 10
min_capacity = 1
instance_types = ["m5.large"]
capacity_type = "ON_DEMAND"
k8s_labels = {
Environment = "test"
GithubRepo = "terraform-aws-eks"
GithubOrg = "terraform-aws-modules"
}
additional_tags = {
ExtraTag = "example"
}
}
}
I want to be able to reference a variable instead of the map in main.tf e.g.
node_groups = var.node_groups
I'm struggling with the various levels of the list(Object) in variables.tf. Thanks in advance for the help.