@@ -34,10 +34,27 @@ func TestAccParallelstoreInstance_parallelstoreInstanceBasicExample_update(t *te
34
34
35
35
acctest.VcrTest(t, resource.TestCase{
36
36
PreCheck: func() { acctest.AccTestPreCheck(t) },
37
+ {{ if ne $.TargetVersionName `ga` -}}
38
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t),
39
+ {{ else }}
37
40
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
38
- CheckDestroy: testAccCheckParallelstoreInstanceDestroyProducer(t),
41
+ {{ end }}
42
+
43
+ CheckDestroy: testAccCheckParallelstoreInstanceDestroyProducer(t),
39
44
Steps: []resource.TestStep{
45
+
46
+ {{ if ne $.TargetVersionName `ga` -}}
47
+ {
48
+ Config: testAccParallelstoreInstance_parallelstoreInstanceBasicExampleBeta_basic(context),
49
+ },
40
50
{
51
+ ResourceName: "google_parallelstore_instance.instance",
52
+ ImportState: true,
53
+ ImportStateVerify: true,
54
+ ImportStateVerifyIgnore: []string{"location", "instance_id", "labels", "terraform_labels"},
55
+ },
56
+ {{ else }}
57
+ {
41
58
Config: testAccParallelstoreInstance_parallelstoreInstanceBasicExample_basic(context),
42
59
},
43
60
{
@@ -55,7 +72,7 @@ func TestAccParallelstoreInstance_parallelstoreInstanceBasicExample_update(t *te
55
72
ImportStateVerify: true,
56
73
ImportStateVerifyIgnore: []string{"location", "instance_id", "labels", "terraform_labels"},
57
74
},
58
-
75
+ {{ end }}
59
76
},
60
77
})
61
78
}
@@ -111,7 +128,6 @@ resource "google_parallelstore_instance" "instance" {
111
128
description = "test instance updated"
112
129
capacity_gib = 12000
113
130
network = google_compute_network.network.name
114
-
115
131
labels = {
116
132
test = "value23"
117
133
}
@@ -142,4 +158,54 @@ resource "google_service_networking_connection" "default" {
142
158
reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
143
159
}
144
160
`, context)
145
- }
161
+ }
162
+
163
+ {{ if ne $.TargetVersionName `ga` -}}
164
+ func testAccParallelstoreInstance_parallelstoreInstanceBasicExampleBeta_basic(context map[string]interface{}) string {
165
+ return acctest.Nprintf(`
166
+ resource "google_parallelstore_instance" "instance" {
167
+ provider = google-beta
168
+ instance_id = "instance%{random_suffix}"
169
+ location = "us-central1-a"
170
+ description = "test instance"
171
+ capacity_gib = 12000
172
+ deployment_type = "SCRATCH"
173
+ network = google_compute_network.network.name
174
+ reserved_ip_range = google_compute_global_address.private_ip_alloc.name
175
+ file_stripe_level = "FILE_STRIPE_LEVEL_MIN"
176
+ directory_stripe_level = "DIRECTORY_STRIPE_LEVEL_MIN"
177
+ labels = {
178
+ test = "value"
179
+ }
180
+ depends_on = [google_service_networking_connection.default]
181
+ }
182
+
183
+ resource "google_compute_network" "network" {
184
+ provider = google-beta
185
+ name = "network%{random_suffix}"
186
+ auto_create_subnetworks = true
187
+ mtu = 8896
188
+ }
189
+
190
+
191
+
192
+ # Create an IP address
193
+ resource "google_compute_global_address" "private_ip_alloc" {
194
+ provider = google-beta
195
+ name = "address%{random_suffix}"
196
+ purpose = "VPC_PEERING"
197
+ address_type = "INTERNAL"
198
+ prefix_length = 24
199
+ network = google_compute_network.network.id
200
+ }
201
+
202
+ # Create a private connection
203
+ resource "google_service_networking_connection" "default" {
204
+ provider = google-beta
205
+ network = google_compute_network.network.id
206
+ service = "servicenetworking.googleapis.com"
207
+ reserved_peering_ranges = [google_compute_global_address.private_ip_alloc.name]
208
+ }
209
+ `, context)
210
+ }
211
+ {{ end }}
0 commit comments