As @maxb notes, it’s important to upgrade these older versions one by one. This is particularly true for v0.12 and v0.13 because they both included some significant changes to Terraform’s designe.
In addition to the note about it getting harder to find help over time, another emerging hazard is that the upgrade instructions were written for the world that existed at the time of release, but like most software Terraform depends on various other external systems, such as Terraform providers and third-party network services, and those continue to evolve over time in ways that are adding extra complications. For example, by now there are some providers whose latest releases are not compatible with Terraform v0.12 or v0.13, so the advice in the documentation of just updating everything to latest is not sufficient. (terraform init
is typically capable of detecting this and describing the problem, though.)
In this particular case the symptoms are familiar to me so I have a guess about what’s happening… I bet this module’s output "instance_id"
block is defined something like this:
output "instance_id" {
value = ["${aws_instance.example.*.id}"]
}
The above technically describes a list of lists rather than just a list, but Terraform v0.11 included a backward-compatibility concession to older versions that didn’t handle this properly which was removed in Terraform v0.12, as described in Referring to List Variables.
The automatic upgrade process described in the documentation should hopefully be able to fix this situation automatically, but note that it’s the child module that’s causing the problem here despite the fact that the error is being reported in the caller, and so you’ll need to complete the upgrade process for the module that the module "ec2-wp"
block is referring to before this will behave correctly.
I would expect the upgrade tool to rewrite the above example to be like this instead:
output "instance_id" {
value = aws_instance.example.*.id
}
However, I don’t recommend making that change manually instead of using the upgrade tool, because once your module includes any amount of syntax that Terraform v0.11 would consider invalid the upgrade tool (which uses Terraform v0.11’s configuration parser) will no longer be able to parse it. Better to start by running the upgrade tool as described in the documentation, and then see what other manual changes you might want or need to make based on its result.