@@ -188,6 +188,49 @@ func TestAccMemorystoreInstance_updateDeletionProtection(t *testing.T) {
188
188
})
189
189
}
190
190
191
+ // Validate that engine version is updated for the cluster
192
+ func TestAccMemorystoreInstance_updateEngineVersion (t * testing.T ) {
193
+ t .Parallel ()
194
+
195
+ name := fmt .Sprintf ("tf-test-%d" , acctest .RandInt (t ))
196
+
197
+ acctest .VcrTest (t , resource.TestCase {
198
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
199
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
200
+ CheckDestroy : testAccCheckMemorystoreInstanceDestroyProducer (t ),
201
+ Steps : []resource.TestStep {
202
+ {
203
+ // create cluster with engine version 7.2
204
+ Config : createOrUpdateMemorystoreInstance (& InstanceParams {
205
+ name : name ,
206
+ shardCount : 3 ,
207
+ zoneDistributionMode : "MULTI_ZONE" ,
208
+ engineVersion : "VALKEY_7_2" ,
209
+ }),
210
+ },
211
+ {
212
+ ResourceName : "google_memorystore_instance.test" ,
213
+ ImportState : true ,
214
+ ImportStateVerify : true ,
215
+ },
216
+ {
217
+ // update cluster with engine version 8.0
218
+ Config : createOrUpdateMemorystoreInstance (& InstanceParams {
219
+ name : name ,
220
+ shardCount : 3 ,
221
+ zoneDistributionMode : "MULTI_ZONE" ,
222
+ engineVersion : "VALKEY_8_0" ,
223
+ }),
224
+ },
225
+ {
226
+ ResourceName : "google_memorystore_instance.test" ,
227
+ ImportState : true ,
228
+ ImportStateVerify : true ,
229
+ },
230
+ },
231
+ })
232
+ }
233
+
191
234
// Validate that persistence config is updated for the cluster
192
235
func TestAccMemorystoreInstance_updatePersistence (t * testing.T ) {
193
236
t .Parallel ()
@@ -236,6 +279,7 @@ type InstanceParams struct {
236
279
zone string
237
280
deletionProtectionEnabled bool
238
281
persistenceMode string
282
+ engineVersion string
239
283
}
240
284
241
285
func createOrUpdateMemorystoreInstance (params * InstanceParams ) string {
@@ -280,6 +324,7 @@ resource "google_memorystore_instance" "test" {
280
324
project_id = data.google_project.project.project_id
281
325
}
282
326
deletion_protection_enabled = %t
327
+ engine_version = "%s"
283
328
engine_configs = {
284
329
%s
285
330
}
@@ -316,5 +361,5 @@ resource "google_compute_network" "producer_net" {
316
361
317
362
data "google_project" "project" {
318
363
}
319
- ` , params .name , params .replicaCount , params .shardCount , params .nodeType , params .deletionProtectionEnabled , strBuilder .String (), zoneDistributionConfigBlock , persistenceBlock , lifecycleBlock , params .name , params .name , params .name )
364
+ ` , params .name , params .replicaCount , params .shardCount , params .nodeType , params .deletionProtectionEnabled , params . engineVersion , strBuilder .String (), zoneDistributionConfigBlock , persistenceBlock , lifecycleBlock , params .name , params .name , params .name )
320
365
}
0 commit comments