@@ -49,13 +49,13 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
4949 testAccCheckGoogleVmwareengineVcenterCredentialsMeta ("data.google_vmwareengine_vcenter_credentials.vcenter-ds" ),
5050 ),
5151 },
52-
5352 {
5453 ResourceName : "google_vmwareengine_private_cloud.vmw-engine-pc" ,
5554 ImportState : true ,
5655 ImportStateVerify : true ,
5756 ImportStateVerifyIgnore : []string {"location" , "name" , "update_time" , "type" , "deletion_delay_hours" , "send_deletion_delay_hours_if_zero" },
5857 },
58+
5959 {
6060 Config : testVmwareenginePrivateCloudUpdateConfig (context ),
6161 Check : resource .ComposeTestCheckFunc (
@@ -69,13 +69,43 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
6969 }),
7070 ),
7171 },
72+ {
73+ ResourceName : "google_vmwareengine_private_cloud.vmw-engine-pc" ,
74+ ImportState : true ,
75+ ImportStateVerify : true ,
76+ ImportStateVerifyIgnore : []string {"location" , "name" , "update_time" , "type" , "deletion_delay_hours" , "send_deletion_delay_hours_if_zero" },
77+ },
7278
79+ {
80+ Config : testVmwareenginePrivateCloudDelayedDeleteConfig (context ),
81+ },
82+ {
83+ ResourceName : "google_vmwareengine_network.vmw-engine-nw" ,
84+ ImportState : true ,
85+ ImportStateVerify : true ,
86+ ImportStateVerifyIgnore : []string {"location" , "name" },
87+ },
88+
89+ {
90+ Config : testVmwareenginePrivateCloudUndeleteConfig (context ),
91+ Check : resource .ComposeTestCheckFunc (
92+ acctest .CheckDataSourceStateMatchesResourceStateWithIgnores (
93+ "data.google_vmwareengine_private_cloud.ds" ,
94+ "google_vmwareengine_private_cloud.vmw-engine-pc" ,
95+ map [string ]struct {}{
96+ "type" : {},
97+ "deletion_delay_hours" : {},
98+ "send_deletion_delay_hours_if_zero" : {},
99+ }),
100+ ),
101+ },
73102 {
74103 ResourceName : "google_vmwareengine_private_cloud.vmw-engine-pc" ,
75104 ImportState : true ,
76105 ImportStateVerify : true ,
77106 ImportStateVerifyIgnore : []string {"location" , "name" , "update_time" , "type" , "deletion_delay_hours" , "send_deletion_delay_hours_if_zero" },
78107 },
108+
79109 {
80110 Config : testVmwareengineSubnetImportConfig (context ),
81111 Check : resource .ComposeTestCheckFunc (
@@ -88,6 +118,7 @@ func TestAccVmwareenginePrivateCloud_vmwareEnginePrivateCloudUpdate(t *testing.T
88118 ImportStateVerify : true ,
89119 ImportStateVerifyIgnore : []string {"parent" , "name" },
90120 },
121+
91122 {
92123 Config : testVmwareengineSubnetUpdateConfig (context ),
93124 },
@@ -106,6 +137,14 @@ func testVmwareenginePrivateCloudCreateConfig(context map[string]interface{}) st
106137}
107138
108139func testVmwareenginePrivateCloudUpdateConfig (context map [string ]interface {}) string {
140+ return testVmwareenginePrivateCloudConfig (context , "sample updated description" , "STANDARD" , 3 , 8 ) + testVmwareengineVcenterNSXCredentailsConfig (context )
141+ }
142+
143+ func testVmwareenginePrivateCloudDelayedDeleteConfig (context map [string ]interface {}) string {
144+ return testVmwareenginePrivateCloudDeletedConfig (context )
145+ }
146+
147+ func testVmwareenginePrivateCloudUndeleteConfig (context map [string ]interface {}) string {
109148 return testVmwareenginePrivateCloudConfig (context , "sample updated description" , "STANDARD" , 3 , 0 ) + testVmwareengineVcenterNSXCredentailsConfig (context )
110149}
111150
@@ -123,7 +162,7 @@ func testVmwareenginePrivateCloudConfig(context map[string]interface{}, descript
123162 context ["description" ] = description
124163 context ["type" ] = pcType
125164 return acctest .Nprintf (`
126- resource "google_vmwareengine_network" "default -nw" {
165+ resource "google_vmwareengine_network" "vmw-engine -nw" {
127166 name = "tf-test-pc-nw-%{random_suffix}"
128167 location = "global"
129168 type = "STANDARD"
@@ -139,7 +178,7 @@ resource "google_vmwareengine_private_cloud" "vmw-engine-pc" {
139178 send_deletion_delay_hours_if_zero = true
140179 network_config {
141180 management_cidr = "192.168.0.0/24"
142- vmware_engine_network = google_vmwareengine_network.default -nw.id
181+ vmware_engine_network = google_vmwareengine_network.vmw-engine -nw.id
143182 }
144183 management_cluster {
145184 cluster_id = "tf-test-sample-mgmt-cluster-custom-core-count%{random_suffix}"
@@ -161,6 +200,17 @@ data "google_vmwareengine_private_cloud" "ds" {
161200` , context )
162201}
163202
203+ func testVmwareenginePrivateCloudDeletedConfig (context map [string ]interface {}) string {
204+ return acctest .Nprintf (`
205+ resource "google_vmwareengine_network" "vmw-engine-nw" {
206+ name = "tf-test-pc-nw-%{random_suffix}"
207+ location = "global"
208+ type = "STANDARD"
209+ description = "PC network description."
210+ }
211+ ` , context )
212+ }
213+
164214func testVmwareengineVcenterNSXCredentailsConfig (context map [string ]interface {}) string {
165215 return acctest .Nprintf (`
166216data "google_vmwareengine_nsx_credentials" "nsx-ds" {
0 commit comments