Subnetwork: Infers region from zone before using the provider-level region #938
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #926
Affects resources with a
zone
field in its schema and using thegetRegion
method:google_compute_instance
google_compute_disk
google_compute_instance_template
This change affects how region is inferred.
The main goal is to change how the region is inferred when a subnetwork is set using the name only (not a self_link).
We used to fallback to the provider-level region first. I changed that to infer the region from the zone in the schema first.
For example, given this config: