Skip to content

Commit daa17b3

Browse files
Remove immutable annotation from nodeType to support vertical scaling.
1 parent 634b382 commit daa17b3

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

mmv1/products/redis/Cluster.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ properties:
279279
The nodeType for the Redis cluster.
280280
If not provided, REDIS_HIGHMEM_MEDIUM will be used as default
281281
required: false
282-
immutable: true
283282
default_from_api: true
284283
enum_values:
285284
- 'REDIS_SHARED_CORE_NANO'

mmv1/third_party/terraform/services/redis/resource_redis_cluster_test.go.tmpl

+13-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/hashicorp/terraform-provider-google/google/acctest"
1111
)
1212

13-
func TestAccRedisCluster_createClusterWithNodeType(t *testing.T) {
13+
func TestAccRedisCluster_createUpdateClusterWithNodeType(t *testing.T) {
1414

1515
t.Parallel()
1616

@@ -22,7 +22,7 @@ func TestAccRedisCluster_createClusterWithNodeType(t *testing.T) {
2222
CheckDestroy: testAccCheckRedisClusterDestroyProducer(t),
2323
Steps: []resource.TestStep{
2424
{
25-
// create cluster with replica count 1
25+
// create cluster with node type "REDIS_STANDARD_SMALL"
2626
Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: true, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", maintenanceDay: "TUESDAY", maintenanceHours: 2, maintenanceMinutes: 0, maintenanceSeconds: 0, maintenanceNanos: 0}),
2727
},
2828
{
@@ -31,9 +31,19 @@ func TestAccRedisCluster_createClusterWithNodeType(t *testing.T) {
3131
ImportStateVerify: true,
3232
ImportStateVerifyIgnore: []string{"psc_configs"},
3333
},
34+
{
35+
// update cluster with node type "REDIS_HIGHMEM_MEDIUM"
36+
Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: true, nodeType: "REDIS_HIGHMEM_MEDIUM", zoneDistributionMode: "MULTI_ZONE", maintenanceDay: "TUESDAY", maintenanceHours: 2, maintenanceMinutes: 0, maintenanceSeconds: 0, maintenanceNanos: 0}),
37+
},
38+
{
39+
ResourceName: "google_redis_cluster.test",
40+
ImportState: true,
41+
ImportStateVerify: true,
42+
ImportStateVerifyIgnore: []string{"psc_configs"},
43+
},
3444
{
3545
// clean up the resource
36-
Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: false, nodeType: "REDIS_STANDARD_SMALL", zoneDistributionMode: "MULTI_ZONE", maintenanceDay: "TUESDAY", maintenanceHours: 2, maintenanceMinutes: 0, maintenanceSeconds: 0, maintenanceNanos: 0}),
46+
Config: createOrUpdateRedisCluster(&ClusterParams{name: name, replicaCount: 1, shardCount: 3, deletionProtectionEnabled: true, nodeType: "REDIS_HIGHMEM_MEDIUM", zoneDistributionMode: "MULTI_ZONE", maintenanceDay: "TUESDAY", maintenanceHours: 2, maintenanceMinutes: 0, maintenanceSeconds: 0, maintenanceNanos: 0}),
3747
},
3848
},
3949
})

0 commit comments

Comments
 (0)