Upgrading to 0.12 assistance

Hi all,

We’re very behind the curve of course, and working on upgrading from 0.11 to 0.12. I’ve ran into an issue I’m struggling to overcome, and was hoping someone in the community could assist:

  • I have many, many modules that I’ve individually ran upgrades on
  • I’m trying to run a plan on one of our environments that use these modules, and I’m getting the following error:
Error: Invalid value for module argument

  on core.tf line 92, in module "environment":
  92:   all_tags = local.all_tags

The given value is not suitable for child module variable "all_tags" defined
at modules/standard/variables.tf:347,1-20: element "fabio_tags": string

core.tf line 92:
all_tags = local.all_tags

This is coming from the defaults.tf:

  all_tags = {
    common_tags = local.common_tags
    ec2_tags = {
      "Patch Group"     = var.patch_group
    fabio_tags = {
      "machine-group" = "fabio"
    sns_tags        = {}
    s3_tags         = {} 
    sqs_tags        = {}
    cloudwatch_tags = {}
  shared_services_tags = {
    common_tags = local.common_tags
    node_tags = {
      "Patch Group"  = var.patch_group

This all worked okay in 0.11, but I’m not sure what the issue is with 0.12. Would anyone have any thoughts or insights into what I’m missing here in the upgrade?

Thank you for any help you can offer! :slight_smile:

What is in the variable {} block within the module? In particular you have the “type” option, which defaults to string. So if you want something else you’d need to update the module. For example “type = map(list(string)” for something like this:

xxx = {
    key1 = ["value1", "value2"]
    key2 = ["value3"]

Thanks for your quick response, apologies for not including that earlier!

There’s quite a lot in there, but I think the main relevant part is this:

variable "all_tags" {
  type = map(string)

The example code you have above isn’t map(string). That suggests something simple like:

all_tags = {
    key1 = "value1"
    key2 = "value2"

but the example included maps, so you are probably wanting “map(map(string))”

Awesome, that’s done it - thank you so much for assisting with this!