With zonal enabled and this module disabled, it would throw the following error...
* module.nat-zone-3.module.nat-gateway.data.google_compute_instance_group.zonal: Resource 'google_compute_instance_group_manager.default' not found for variable 'google_compute_instance_group_manager.default.name'
Fix
The problem is an inherent problem lower level in Terraform, not "fully" respecting the count on a data resource to not try to resolve all dependencies inside an unused (count = 0) data stanza. This is a well known problem, and the workaround is to have a cascading value to fall back onto, hence the concat+element trick.
Problem
With zonal enabled and this module disabled, it would throw the following error...
Fix
The problem is an inherent problem lower level in Terraform, not "fully" respecting the count on a data resource to not try to resolve all dependencies inside an unused (count = 0) data stanza. This is a well known problem, and the workaround is to have a cascading value to fall back onto, hence the concat+element trick.