Skip to content

terraform v0.12.12: When using "for_each", the key can be a string #133

@karabijavad

Description

@karabijavad

This results in this error:
Error reading tfstate file: 0.12 format error: json: cannot unmarshal string into Go struct field resourceStateTerraform0dot12.index of type int; pre-0.12 format error: <nil> (nil error means no content/modules found in the respective format)

example:

data aws_iam_user staff_users {
  for_each  = var.staff_aws_usernames
  user_name = each.value
}

The above causes "index" to be a string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions