@@ -25,15 +25,6 @@ import (
2525
2626const CMK_ENABLED_STRING = "customer-managed-key"
2727
28- func containsModule (modules []interface {}, requiredModule string ) bool {
29- for _ , m := range modules {
30- if mod , ok := m .(string ); ok && mod == requiredModule {
31- return true
32- }
33- }
34- return false
35- }
36-
3728func ResourceRedisCloudProSubscription () * schema.Resource {
3829 return & schema.Resource {
3930
@@ -48,28 +39,6 @@ func ResourceRedisCloudProSubscription() *schema.Resource {
4839 return nil
4940 }
5041
51- // Validate "query_performance_factor" dependency on "modules"
52- creationPlan := diff .Get ("creation_plan" ).([]interface {})
53- if len (creationPlan ) > 0 {
54- plan := creationPlan [0 ].(map [string ]interface {})
55-
56- qpf , qpfExists := plan ["query_performance_factor" ].(string )
57-
58- // Ensure "modules" key is explicitly defined in HCL
59- _ , modulesExists := diff .GetOkExists ("creation_plan.0.modules" )
60-
61- if qpfExists && qpf != "" {
62- if ! modulesExists {
63- return fmt .Errorf (`"query_performance_factor" requires the "modules" key to be explicitly defined in HCL` )
64- }
65-
66- modules , _ := plan ["modules" ].([]interface {})
67- if ! containsModule (modules , "RediSearch" ) {
68- return fmt .Errorf (`"query_performance_factor" requires the "modules" list to contain "RediSearch"` )
69- }
70- }
71- }
72-
7342 err := cloudRegionsForceNewDiff (ctx , diff , meta )
7443 if err != nil {
7544 return err
0 commit comments