We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tofu will only report resources in the root of the terraform state tree.
tofu
root
The problem is in L111: this assumes there is no terraform module being used except for the main, root definition.
Instead of hardcoded value of 0, self.data.modules should iterated because the length can be n.
0
self.data.modules
n
An example from a more complex terraform infra using modules:
>>> len(data['modules']) 8 >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][0]['resources'].keys() ) [] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][1]['resources'].keys() ) [] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][2]['resources'].keys() ) [] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][3]['resources'].keys() ) [] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][4]['resources'].keys() ) [] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][5]['resources'].keys() ) [u'openstack_compute_instance_v2.vm_2n.0', u'openstack_compute_instance_v2.vm_2n.1', u'openstack_compute_instance_v2.vm_2n.2'] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][6]['resources'].keys() ) [u'openstack_compute_instance_v2.vm_2n.0', u'openstack_compute_instance_v2.vm_2n.1', u'openstack_compute_instance_v2.vm_2n.2'] >>> filter( lambda x : re.search('openstack_compute_instance_v2', x), data['modules'][7]['resources'].keys() ) [u'openstack_compute_instance_v2.instance']
This is because in this tf infra there is no vm being built in the root, but only using modules.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tofu
will only report resources in theroot
of the terraform state tree.The problem is in L111: this assumes there is no terraform module being used except for the main, root definition.
Instead of hardcoded value of
0
,self.data.modules
should iterated because the length can ben
.An example from a more complex terraform infra using modules:
This is because in this tf infra there is no vm being built in the root, but only using modules.
The text was updated successfully, but these errors were encountered: