mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 07:42:40 +00:00
Fix explicitly setting the default network + subnetwork in GKE (#3492)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
13b49cfcb0
commit
4688b0d33f
|
@ -634,6 +634,14 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
|
|||
return err
|
||||
}
|
||||
|
||||
// When parsing a subnetwork by name, we expect region or zone to be set.
|
||||
// Users may have set location to either value, so set that value.
|
||||
if isZone(location) {
|
||||
d.Set("zone", location)
|
||||
} else {
|
||||
d.Set("region", location)
|
||||
}
|
||||
|
||||
clusterName := d.Get("name").(string)
|
||||
|
||||
cluster := &containerBeta.Cluster{
|
||||
|
|
|
@ -1416,6 +1416,9 @@ resource "google_container_cluster" "primary" {
|
|||
name = "%s"
|
||||
location = "us-central1-a"
|
||||
initial_node_count = 3
|
||||
|
||||
network = "default"
|
||||
subnetwork = "default"
|
||||
}`, name)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user