Terraform | After upgrading to 0.12 receive a lots of error "unsupported value for "%s" at 0: string required."
There is a clue in your error message, but it's only helpful if you know what you're looking for:

    | module.mongodb.instance_names is tuple with 1 element
    | module.mongodb.private_ip is list of string with 1 element


Your declaration of the instance_names output includes this expression:

["${data.template_file.instance_tags_name.*.rendered}"]


The data.template_file.instance_tags_name.*.rendered part of this returns a list of strings, and then the [ ... ] around it then wraps an extra list (or rather, tuple) around it, creating a single-element tuple containing a list of strings. That's why the tuple contains only one element, rather than having an element for each of your count instances.

This situation is what the upgrade guide discusses under Referring to List Variables, and that documentation includes some more background information on why this previously worked in 0.11 and why the change is required now.

To fix this, you should refer to just the splat expression alone, producing the flat list of strings that your formatlist call is expecting:

output "instance_names" {
  value = data.template_file.instance_tags_name.*.rendered
}


The automatic configuration upgrade tool described in the upgrade guide can make this change automatically in some cases, so I'd recommend using that as a starting point for your 0.12 upgrade process. It isn't able to fix everything, but it will do a lot of the straightforward rewriting work for you and will emit warnings about some more complex situations it's unable to handle.