Description
Looks like the region
output of the beta_private_cluster module (computed from a local.cluster_output_region, assigned as cluster_output_region = google_container_cluster.primary.region
) can be null. This potentially breaks tests.
The case that I exercised was as follows:
regional = false
region = 'us-east4'
zones = ['us-east4-a']
According to the documentation of the google_container_cluster resource, the region attribute is deprecated, and will only have a value if the cluster is regional instead of zonal. The module should be computing the region from the location (zone), in a zonal cluster, if it is going to output a region - since tests for the with_network examples require a region. Location will contain the region in a regional cluster.
I fixed the private_zonal_with_network example by using the incoming variable as the output value instead of retrieving it from the resource attribute.