diff --git a/.changelog/11460.txt b/.changelog/11460.txt new file mode 100644 index 0000000000..beee0a118a --- /dev/null +++ b/.changelog/11460.txt @@ -0,0 +1,3 @@ +```release-note:deprecation +alloydb: `network` removed in `google_alloy_db_cluster`. Use `network_config.network` instead. +``` \ No newline at end of file diff --git a/google-beta/services/alloydb/resource_alloydb_backup_generated_test.go b/google-beta/services/alloydb/resource_alloydb_backup_generated_test.go index 8ec93c7e2e..f862de06d0 100644 --- a/google-beta/services/alloydb/resource_alloydb_backup_generated_test.go +++ b/google-beta/services/alloydb/resource_alloydb_backup_generated_test.go @@ -69,7 +69,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { @@ -129,7 +131,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { diff --git a/google-beta/services/alloydb/resource_alloydb_backup_test.go b/google-beta/services/alloydb/resource_alloydb_backup_test.go index b0db476ebf..fecf3b364e 100644 --- a/google-beta/services/alloydb/resource_alloydb_backup_test.go +++ b/google-beta/services/alloydb/resource_alloydb_backup_test.go @@ -62,7 +62,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { @@ -96,7 +98,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { @@ -144,7 +148,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { location = "us-central1" cluster_id = "tf-test-alloydb-cluster%{random_suffix}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" { } @@ -211,7 +217,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "default" { diff --git a/google-beta/services/alloydb/resource_alloydb_cluster.go b/google-beta/services/alloydb/resource_alloydb_cluster.go index 6c03310671..b3dffcbabb 100644 --- a/google-beta/services/alloydb/resource_alloydb_cluster.go +++ b/google-beta/services/alloydb/resource_alloydb_cluster.go @@ -383,17 +383,6 @@ Please refer to the field 'effective_labels' for all of the labels present on th }, }, }, - "network": { - Type: schema.TypeString, - Computed: true, - Optional: true, - Deprecated: "`network` is deprecated and will be removed in a future major release. Instead, use `network_config` to define the network configuration.", - DiffSuppressFunc: tpgresource.ProjectNumberDiffSuppress, - Description: `The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: - -"projects/{projectNumber}/global/networks/{network_id}".`, - ExactlyOneOf: []string{"network", "network_config.0.network", "psc_config.0.psc_enabled"}, - }, "network_config": { Type: schema.TypeList, Computed: true, @@ -414,7 +403,7 @@ If set, the instance IPs for this cluster will be created in the allocated range DiffSuppressFunc: tpgresource.ProjectNumberDiffSuppress, Description: `The resource link for the VPC network in which cluster resources are created and from which they are accessible via Private IP. The network must belong to the same project as the cluster. It is specified in the form: "projects/{projectNumber}/global/networks/{network_id}".`, - ExactlyOneOf: []string{"network", "network_config.0.network", "psc_config.0.psc_enabled"}, + ExactlyOneOf: []string{"network_config.0.network", "psc_config.0.psc_enabled"}, }, }, }, @@ -675,12 +664,6 @@ func resourceAlloydbClusterCreate(d *schema.ResourceData, meta interface{}) erro } else if v, ok := d.GetOkExists("encryption_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(encryptionConfigProp)) && (ok || !reflect.DeepEqual(v, encryptionConfigProp)) { obj["encryptionConfig"] = encryptionConfigProp } - networkProp, err := expandAlloydbClusterNetwork(d.Get("network"), d, config) - if err != nil { - return err - } else if v, ok := d.GetOkExists("network"); !tpgresource.IsEmptyValue(reflect.ValueOf(networkProp)) && (ok || !reflect.DeepEqual(v, networkProp)) { - obj["network"] = networkProp - } networkConfigProp, err := expandAlloydbClusterNetworkConfig(d.Get("network_config"), d, config) if err != nil { return err @@ -958,9 +941,6 @@ func resourceAlloydbClusterRead(d *schema.ResourceData, meta interface{}) error if err := d.Set("continuous_backup_info", flattenAlloydbClusterContinuousBackupInfo(res["continuousBackupInfo"], d, config)); err != nil { return fmt.Errorf("Error reading Cluster: %s", err) } - if err := d.Set("network", flattenAlloydbClusterNetwork(res["network"], d, config)); err != nil { - return fmt.Errorf("Error reading Cluster: %s", err) - } if err := d.Set("network_config", flattenAlloydbClusterNetworkConfig(res["networkConfig"], d, config)); err != nil { return fmt.Errorf("Error reading Cluster: %s", err) } @@ -1041,12 +1021,6 @@ func resourceAlloydbClusterUpdate(d *schema.ResourceData, meta interface{}) erro } else if v, ok := d.GetOkExists("encryption_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, encryptionConfigProp)) { obj["encryptionConfig"] = encryptionConfigProp } - networkProp, err := expandAlloydbClusterNetwork(d.Get("network"), d, config) - if err != nil { - return err - } else if v, ok := d.GetOkExists("network"); !tpgresource.IsEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, networkProp)) { - obj["network"] = networkProp - } networkConfigProp, err := expandAlloydbClusterNetworkConfig(d.Get("network_config"), d, config) if err != nil { return err @@ -1139,10 +1113,6 @@ func resourceAlloydbClusterUpdate(d *schema.ResourceData, meta interface{}) erro updateMask = append(updateMask, "encryptionConfig") } - if d.HasChange("network") { - updateMask = append(updateMask, "network") - } - if d.HasChange("network_config") { updateMask = append(updateMask, "networkConfig") } @@ -1507,10 +1477,6 @@ func flattenAlloydbClusterContinuousBackupInfoEncryptionInfoKmsKeyVersions(v int return v } -func flattenAlloydbClusterNetwork(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { - return v -} - func flattenAlloydbClusterNetworkConfig(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { if v == nil { return nil @@ -2093,10 +2059,6 @@ func expandAlloydbClusterEncryptionConfigKmsKeyName(v interface{}, d tpgresource return v, nil } -func expandAlloydbClusterNetwork(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { - return v, nil -} - func expandAlloydbClusterNetworkConfig(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { l := v.([]interface{}) if len(l) == 0 || l[0] == nil { diff --git a/google-beta/services/alloydb/resource_alloydb_cluster_generated_test.go b/google-beta/services/alloydb/resource_alloydb_cluster_generated_test.go index 84b42e8570..baaa70fff8 100644 --- a/google-beta/services/alloydb/resource_alloydb_cluster_generated_test.go +++ b/google-beta/services/alloydb/resource_alloydb_cluster_generated_test.go @@ -187,7 +187,9 @@ func testAccAlloydbCluster_alloydbSecondaryClusterBasicTestExample(context map[s resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -203,7 +205,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/google-beta/services/alloydb/resource_alloydb_cluster_restore_test.go b/google-beta/services/alloydb/resource_alloydb_cluster_restore_test.go index c8c5347930..c89a9d4179 100644 --- a/google-beta/services/alloydb/resource_alloydb_cluster_restore_test.go +++ b/google-beta/services/alloydb/resource_alloydb_cluster_restore_test.go @@ -88,7 +88,9 @@ func testAccAlloydbClusterAndInstanceAndBackup(context map[string]interface{}) s resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -119,7 +121,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_OnlyOneSourceAllowed(context map[ resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -139,7 +143,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -167,7 +173,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_SourceClusterAndPointInTimeRequir resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -187,7 +195,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name @@ -211,7 +221,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackup(context map[st resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -231,7 +243,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -256,7 +270,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -276,7 +292,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -289,7 +307,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = google_alloydb_backup.default.update_time @@ -315,7 +335,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -335,7 +357,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -353,7 +377,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = google_alloydb_backup.default.update_time @@ -384,7 +410,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -412,7 +440,9 @@ resource "google_alloydb_backup" "default2" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default2.name } @@ -432,7 +462,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.restored_from_backup.name point_in_time = google_alloydb_backup.default.update_time @@ -463,7 +495,9 @@ func testAccAlloydbClusterAndInstanceAndBackup_RestoredFromBackupAndRestoredFrom resource "google_alloydb_cluster" "source" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "source" { @@ -483,7 +517,9 @@ resource "google_alloydb_backup" "default" { resource "google_alloydb_cluster" "restored_from_backup" { cluster_id = "tf-test-alloydb-backup-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_backup_source { backup_name = google_alloydb_backup.default.name } @@ -492,7 +528,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_from_point_in_time" { cluster_id = "tf-test-alloydb-pitr-restored-cluster-%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = google_alloydb_backup.default.update_time diff --git a/google-beta/services/alloydb/resource_alloydb_cluster_test.go b/google-beta/services/alloydb/resource_alloydb_cluster_test.go index 929ea9c7b7..1f280e2665 100644 --- a/google-beta/services/alloydb/resource_alloydb_cluster_test.go +++ b/google-beta/services/alloydb/resource_alloydb_cluster_test.go @@ -52,7 +52,9 @@ func testAccAlloydbCluster_update(context map[string]interface{}) string { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } labels = { foo = "bar" @@ -190,7 +192,9 @@ func testAccAlloydbCluster_withInitialUserAndAutomatedBackupPolicy(context map[s resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } initial_user { user = "tf-test-alloydb-cluster%{random_suffix}" @@ -240,7 +244,9 @@ func testAccAlloydbCluster_withoutInitialUserAndAutomatedBackupPolicy(context ma resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } lifecycle { prevent_destroy = true } @@ -285,7 +291,9 @@ func testAccAlloydbCluster_missingWeeklySchedule(context map[string]interface{}) resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } automated_backup_policy { location = "us-central1" backup_window = "1800s" @@ -386,7 +394,9 @@ func testAccAlloydbCluster_withTimeBasedRetentionPolicy(context map[string]inter resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } automated_backup_policy { location = "us-central1" backup_window = "1800s" @@ -427,7 +437,9 @@ func testAccAlloydbCluster_withoutTimeBasedRetentionPolicy(context map[string]in resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } automated_backup_policy { location = "us-central1" backup_window = "1800s" @@ -490,7 +502,9 @@ func testAccAlloydbCluster_usingCMEK(context map[string]interface{}) string { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -565,7 +579,9 @@ func testAccAlloydbCluster_usingCMEKInClusterAndAutomatedBackup(context map[stri resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -615,7 +631,9 @@ func testAccAlloydbCluster_updateCMEKInAutomatedBackup(context map[string]interf resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -676,7 +694,9 @@ func testAccAlloydbCluster_usingCMEKallowDeletion(context map[string]interface{} resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } encryption_config { kms_key_name = google_kms_crypto_key.key.id } @@ -923,7 +943,9 @@ func testAccAlloydbCluster_withoutContinuousBackupConfig(context map[string]inte resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } lifecycle { prevent_destroy = true } @@ -943,7 +965,9 @@ func testAccAlloydbCluster_continuousBackupConfig(context map[string]interface{} resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } continuous_backup_config { enabled = %{enabled} @@ -1022,7 +1046,9 @@ func testAccAlloydbCluster_usingCMEKInClusterAndContinuousBackup(context map[str resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } continuous_backup_config { enabled = true recovery_window_days = 20 @@ -1055,7 +1081,9 @@ func testAccAlloydbCluster_continuousBackupUsingCMEKAllowDeletion(context map[st resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } continuous_backup_config { enabled = true recovery_window_days = 20 @@ -1111,7 +1139,7 @@ resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" } } data "google_project" "project" {} @@ -1152,8 +1180,8 @@ resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" - allocated_ip_range = google_compute_global_address.private_ip_alloc.name + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + allocated_ip_range = google_compute_global_address.private_ip_alloc.name } } data "google_project" "project" {} @@ -1202,7 +1230,7 @@ resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" } maintenance_update_policy { maintenance_windows { @@ -1254,7 +1282,9 @@ func testAccAlloydbCluster_withMaintenanceWindowMissingStartTime(context map[str resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } maintenance_update_policy { maintenance_windows { @@ -1276,7 +1306,9 @@ func testAccAlloydbCluster_withMaintenanceWindowMissingDay(context map[string]in resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + network_config { + network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}" + } maintenance_update_policy { maintenance_windows { diff --git a/google-beta/services/alloydb/resource_alloydb_instance_generated_test.go b/google-beta/services/alloydb/resource_alloydb_instance_generated_test.go index 3bd1b01bee..a19bd520b7 100644 --- a/google-beta/services/alloydb/resource_alloydb_instance_generated_test.go +++ b/google-beta/services/alloydb/resource_alloydb_instance_generated_test.go @@ -71,8 +71,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } @@ -117,7 +118,9 @@ func testAccAlloydbInstance_alloydbSecondaryInstanceBasicTestExample(context map resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -133,7 +136,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/google-beta/services/alloydb/resource_alloydb_instance_test.go b/google-beta/services/alloydb/resource_alloydb_instance_test.go index 2d691c8985..3ad3136ea1 100644 --- a/google-beta/services/alloydb/resource_alloydb_instance_test.go +++ b/google-beta/services/alloydb/resource_alloydb_instance_test.go @@ -60,8 +60,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } @@ -92,7 +93,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" @@ -137,7 +140,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -207,7 +212,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -260,7 +267,9 @@ resource "google_alloydb_instance" "read_pool" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -314,7 +323,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -339,7 +350,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -527,7 +540,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -556,7 +571,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } data "google_project" "project" {} @@ -670,7 +687,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } @@ -705,7 +724,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf-test-alloydb-cluster%{random_suffix}" } diff --git a/google-beta/services/alloydb/resource_alloydb_secondary_cluster_test.go b/google-beta/services/alloydb/resource_alloydb_secondary_cluster_test.go index a939454678..c3612d097e 100644 --- a/google-beta/services/alloydb/resource_alloydb_secondary_cluster_test.go +++ b/google-beta/services/alloydb/resource_alloydb_secondary_cluster_test.go @@ -43,7 +43,9 @@ func testAccAlloydbCluster_secondaryClusterMandatoryFields(context map[string]in resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -59,7 +61,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -108,7 +112,9 @@ func testAccAlloydbCluster_secondaryClusterMissingSecondaryConfig(context map[st resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -124,7 +130,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -172,7 +180,9 @@ func testAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButMissingClust resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -188,7 +198,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } continuous_backup_config { enabled = false @@ -236,7 +248,9 @@ func testAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButClusterTypeI resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -252,7 +266,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -315,7 +331,9 @@ func testAccAlloydbCluster_secondaryClusterUpdate(context map[string]interface{} resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -331,7 +349,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -389,7 +409,9 @@ func testAccAlloydbCluster_secondaryClusterUsingCMEK(context map[string]interfac resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -405,7 +427,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -483,7 +507,7 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" } } @@ -501,7 +525,7 @@ resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" } cluster_type = "SECONDARY" @@ -558,8 +582,8 @@ resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" - allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name } } @@ -577,8 +601,8 @@ resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" network_config { - network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" - allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name + network = "projects/${data.google_project.project.number}/global/networks/${data.google_compute_network.default.name}" + allocated_ip_range = data.google_compute_global_address.private_ip_alloc.name } cluster_type = "SECONDARY" @@ -647,7 +671,9 @@ func testAccAlloydbInstance_secondaryClusterWithInstance(context map[string]inte resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -663,7 +689,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -706,7 +734,9 @@ func testAccAlloydbCluster_secondaryClusterPromote(context map[string]interface{ resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -722,7 +752,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -794,7 +826,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndSimultaneousUpdate(context resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -810,7 +844,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -895,7 +931,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndDeleteOriginalPrimary(conte resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -976,7 +1014,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndUpdate(context map[string]i resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -992,7 +1032,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1255,7 +1297,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndAddAutomatedBackupPolicyAnd resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1271,7 +1315,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1391,7 +1437,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteWithTimeBasedRetentionPolicy(c resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1407,7 +1455,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1472,7 +1522,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteWithoutTimeBasedRetentionPolic resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1488,7 +1540,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { @@ -1596,7 +1650,9 @@ func testAccAlloydbCluster_secondaryClusterPromoteAndAddContinuousBackupConfig(c resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -1612,7 +1668,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "%{secondary_cluster_location}" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "PRIMARY" continuous_backup_config { diff --git a/google-beta/services/alloydb/resource_alloydb_secondary_instance_test.go b/google-beta/services/alloydb/resource_alloydb_secondary_instance_test.go index b47717dbd1..68064af18c 100644 --- a/google-beta/services/alloydb/resource_alloydb_secondary_instance_test.go +++ b/google-beta/services/alloydb/resource_alloydb_secondary_instance_test.go @@ -50,7 +50,9 @@ func testAccAlloydbInstance_secondaryInstanceInitial(context map[string]interfac resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -66,7 +68,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -105,7 +109,9 @@ func testAccAlloydbInstance_secondaryInstanceUpdateMachineConfig(context map[str resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -121,7 +127,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -187,7 +195,9 @@ func testAccAlloydbInstance_secondaryInstanceWithReadPoolInstance(context map[st resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -203,7 +213,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-west1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -381,7 +393,9 @@ func testAccAlloydbInstance_secondaryInstanceUpdateDatabaseFlag(context map[stri resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -397,7 +411,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -476,7 +492,9 @@ func testAccAlloydbInstance_secondaryInstanceUpdateQueryInsightConfig(context ma resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -492,7 +510,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-east1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -565,7 +585,9 @@ func testAccAlloydbInstance_secondaryInstanceMaximumFields(context map[string]in resource "google_alloydb_cluster" "primary" { cluster_id = "tf-test-alloydb-primary-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -581,7 +603,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "tf-test-alloydb-secondary-cluster%{random_suffix}" location = "us-west1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/google-beta/services/alloydb/resource_alloydb_user_generated_test.go b/google-beta/services/alloydb/resource_alloydb_user_generated_test.go index cea8fc510e..5a24048076 100644 --- a/google-beta/services/alloydb/resource_alloydb_user_generated_test.go +++ b/google-beta/services/alloydb/resource_alloydb_user_generated_test.go @@ -67,8 +67,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" } @@ -130,8 +131,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" } diff --git a/google-beta/services/alloydb/resource_alloydb_user_test.go b/google-beta/services/alloydb/resource_alloydb_user_test.go index f2c4d9bda7..b1e973ddba 100644 --- a/google-beta/services/alloydb/resource_alloydb_user_test.go +++ b/google-beta/services/alloydb/resource_alloydb_user_test.go @@ -55,7 +55,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" @@ -125,7 +127,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" @@ -194,7 +198,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "tf-test-alloydb-cluster%{random_suffix}" location = "us-central1" - network = data.google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "tf_test_cluster_secret%{random_suffix}" } diff --git a/website/docs/guides/version_6_upgrade.html.markdown b/website/docs/guides/version_6_upgrade.html.markdown index bb87693683..b2acc21c30 100644 --- a/website/docs/guides/version_6_upgrade.html.markdown +++ b/website/docs/guides/version_6_upgrade.html.markdown @@ -335,6 +335,12 @@ in GCP, including the labels configured through Terraform, the system, and other ## Removals +### Resource: `google_alloydb_cluster` + +## `network` is now removed + +`network` has been removed in favor of `network_config.network` + ### Resource: `google_identity_platform_project_default_config` is now removed `google_identity_platform_project_default_config` is removed in favor of `google_identity_platform_project_config` diff --git a/website/docs/r/alloydb_cluster.html.markdown b/website/docs/r/alloydb_cluster.html.markdown index 718a4d8e28..e1a3a0d3cd 100644 --- a/website/docs/r/alloydb_cluster.html.markdown +++ b/website/docs/r/alloydb_cluster.html.markdown @@ -177,8 +177,9 @@ resource "google_alloydb_cluster" "restored_from_backup" { resource "google_alloydb_cluster" "restored_via_pitr" { cluster_id = "alloydb-pitr-restored" location = "us-central1" - network = data.google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } restore_continuous_backup_source { cluster = google_alloydb_cluster.source.name point_in_time = "2023-08-03T19:19:00.094Z" @@ -212,7 +213,9 @@ resource "google_service_networking_connection" "vpc_connection" { resource "google_alloydb_cluster" "primary" { cluster_id = "alloydb-primary-cluster" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -230,7 +233,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "alloydb-secondary-cluster" location = "us-east1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { @@ -293,13 +298,6 @@ The following arguments are supported: EncryptionConfig describes the encryption config of a cluster or a backup that is encrypted with a CMEK (customer-managed encryption key). Structure is [documented below](#nested_encryption_config). -* `network` - - (Optional, Deprecated) - The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form: - "projects/{projectNumber}/global/networks/{network_id}". - - ~> **Warning:** `network` is deprecated and will be removed in a future major release. Instead, use `network_config` to define the network configuration. - * `network_config` - (Optional) Metadata related to network configuration. diff --git a/website/docs/r/alloydb_instance.html.markdown b/website/docs/r/alloydb_instance.html.markdown index 8c75317527..11c0fde863 100644 --- a/website/docs/r/alloydb_instance.html.markdown +++ b/website/docs/r/alloydb_instance.html.markdown @@ -87,7 +87,9 @@ resource "google_service_networking_connection" "vpc_connection" { resource "google_alloydb_cluster" "primary" { cluster_id = "alloydb-primary-cluster" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } } resource "google_alloydb_instance" "primary" { @@ -105,7 +107,9 @@ resource "google_alloydb_instance" "primary" { resource "google_alloydb_cluster" "secondary" { cluster_id = "alloydb-secondary-cluster" location = "us-east1" - network = google_compute_network.default.id + network_config { + network = data.google_compute_network.default.id + } cluster_type = "SECONDARY" continuous_backup_config { diff --git a/website/docs/r/alloydb_user.html.markdown b/website/docs/r/alloydb_user.html.markdown index b4397ef47b..8a25afffe3 100644 --- a/website/docs/r/alloydb_user.html.markdown +++ b/website/docs/r/alloydb_user.html.markdown @@ -43,8 +43,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "alloydb-cluster" location = "us-central1" - network = google_compute_network.default.id - + network_config { + network = data.google_compute_network.default.id + } initial_user { password = "cluster_secret" } @@ -95,7 +96,9 @@ resource "google_alloydb_instance" "default" { resource "google_alloydb_cluster" "default" { cluster_id = "alloydb-cluster" location = "us-central1" - network = google_compute_network.default.id + network_config { + network = google_compute_network.default.id + } initial_user { password = "cluster_secret"