scholzj / terraform-aws-kubernetes

Terraform module for Kubernetes setup on AWS
Apache License 2.0
200 stars 129 forks source link

Tags must be a list instead of map #3

Closed guilhermeblanco closed 6 years ago

guilhermeblanco commented 6 years ago

Terraform supports defining tags as a map instead of a list of maps (like shown in the example usage).

This means situations like this are valid:

module "kubernetes" {
  tags = "${merge(
    map("Name", format("%v-kubernetes", var.vpc_name)),
    map("Country", substr(var.region, 0, 2)),
    map("DataCenter", substr(var.region, 3, length(var.region) - 5)),
    var.tags
  )}"

  tags2 = {
    Name = "${var.vpc_name}-kubernetes"
    Country = "ca"
    DataCenter = "central"
  }
}

However, trying these situations does not work and complains returning:

* module.management.module.kubernetes.var.tags2: variable tags2 in module management.kubernetes should be type list, got map
guilhermeblanco commented 6 years ago

Meh, I understand the reason now. Closing.