Skip to content

Commit 3d7b686

Browse files
add tests
1 parent d89901f commit 3d7b686

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

mmv1/products/memorystore/Instance.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ properties:
211211
- name: 'nodeType'
212212
type: String
213213
description:
214-
"Optional. Immutable. Machine type for individual nodes of the instance.
214+
"Optional. Machine type for individual nodes of the instance.
215215
\n Possible values:\n SHARED_CORE_NANO\nHIGHMEM_MEDIUM\nHIGHMEM_XLARGE\nSTANDARD_SMALL"
216-
immutable: true
217216
default_from_api: true
218217
- name: 'persistenceConfig'
219218
type: NestedObject

mmv1/third_party/terraform/services/memorystore/resource_memorystore_instance_test.go

+43
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,49 @@ func TestAccMemorystoreInstance_updateDeletionProtection(t *testing.T) {
186186
})
187187
}
188188

189+
// Validate that node type is updated for the cluster
190+
func TestAccMemorystoreInstance_updateNodeType(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 deletion protection true
202+
Config: createOrUpdateMemorystoreInstance(&InstanceParams{
203+
name: name,
204+
shardCount: 3,
205+
zoneDistributionMode: "MULTI_ZONE",
206+
nodeType: "HIGHMEM_MEDIUM",
207+
}),
208+
},
209+
{
210+
ResourceName: "google_memorystore_instance.test",
211+
ImportState: true,
212+
ImportStateVerify: true,
213+
},
214+
{
215+
// update cluster with deletion protection false
216+
Config: createOrUpdateMemorystoreInstance(&InstanceParams{
217+
name: name,
218+
shardCount: 3,
219+
zoneDistributionMode: "MULTI_ZONE",
220+
nodeType: "STANDARD_SMALL",
221+
}),
222+
},
223+
{
224+
ResourceName: "google_memorystore_instance.test",
225+
ImportState: true,
226+
ImportStateVerify: true,
227+
},
228+
},
229+
})
230+
}
231+
189232
// Validate that persistence config is updated for the cluster
190233
func TestAccMemorystoreInstance_updatePersistence(t *testing.T) {
191234
t.Parallel()

0 commit comments

Comments
 (0)