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