Problem
Terraform version affected: v1.1.0
Output:
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
runtime error: invalid memory address or nil pointer
Cause
Previously we were treating it as a programming error to ask for the instances of a resource inside an instance of a module that is declared but whose declaration doesn't include the given instance key.
However, that's actually a valid situation which can arise if, for example, the user has changed the repetition/expansion mode for an existing module call and so now all of the resource instances addresses it previously contained are "orphaned".
To represent that, we will instead say that an invalid instance key of a declared module behaves as if it contains no resource instances at all, regardless of the configurations of any resources nested inside. This then gives the result needed to successfully detect all of the former resource instances as "orphaned" and plan to destroy them.
Solution
Please upgrade to v1.1.2 as soon as possible to receive the Bug fix
***Note: The fix is available in v1.1.1 but it is highly recommended to upgrade to v1.1.2 due a bug in v1.1.1 Terraform applied no changes and unexpectedly emptied the State File
Additional Information
- Visit the v1.1.2 Release Notes here for more information.
- Visit the v1.1.1 Release Notes here for more information.
-
If needed, please raise a support ticket for additional help.