Closed megakoresh closed 6 years ago
Hi @megakoresh! Sorry for this bug and sorry for the slow response.
The issue you've hit here has the same root cause as #14677, which is now fixed in master and will be included in the forthcoming v0.12.0 release.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
If you have a module that accepts e.g. a list of IDs, and you give it the IDs from another module's output, and then try to spawn resources inside the first module.
Terraform Version
Terraform Configuration Files
output of the module is defined like so
input is used in the receiving module like so
Note that
admin_group_id = "${module.secgroup_admin.group_id}"
is correctly processed into dependency graph.Debug Output
N/A
Crash Output
Expected Behavior
The count should be evaluated after the previous module's output is available
Actual Behavior
Terraform does not include module outputs declared within lists and maps and thus crashes because contents are not available.
Steps to Reproduce
Construct the configuration resembling the above example.
Additional Context
Provider is openstack. There is no workaround for this. Using
null_resource
has no effect.References
There is a LOT of open and closed issues about module-on-module dependencies which would solve this, but the ideal solution would be fix this behaviour to be consistent with string type references.