@@ -25,7 +25,6 @@ func TestAccResourceRedisCloudProDatabase_Redis8_CRUDI(t *testing.T) {
2525 password := acctest .RandString (20 )
2626 const resourceName = "rediscloud_subscription_database.example"
2727 const subscriptionResourceName = "rediscloud_subscription.example"
28- const replicaResourceName = "rediscloud_subscription_database.example_replica"
2928 testCloudAccountName := os .Getenv ("AWS_TEST_CLOUD_ACCOUNT_NAME" )
3029
3130 var subId int
@@ -63,12 +62,6 @@ func TestAccResourceRedisCloudProDatabase_Redis8_CRUDI(t *testing.T) {
6362 resource .TestCheckResourceAttr (resourceName , "tags.market" , "emea" ),
6463 resource .TestCheckResourceAttr (resourceName , "tags.material" , "cardboard" ),
6564
66- // Replica tests
67- resource .TestCheckResourceAttr (replicaResourceName , "name" , "example-replica" ),
68- // should be the value specified in the replica config, rather than the primary database
69- resource .TestCheckResourceAttr (replicaResourceName , "dataset_size_in_gb" , "1" ),
70- resource .TestCheckResourceAttr (replicaResourceName , "replica_of.#" , "1" ),
71-
7265 // Test databases exist
7366 func (s * terraform.State ) error {
7467 r := s .RootModule ().Resources [subscriptionResourceName ]
@@ -103,36 +96,11 @@ func TestAccResourceRedisCloudProDatabase_Redis8_CRUDI(t *testing.T) {
10396 },
10497 // Test database is updated successfully to Redis 8.0
10598 {
106- Config : getRedis8DatabaseUpdateConfig (t , testCloudAccountName , name ),
99+ Config : getRedis8DatabaseUpdateConfig (t , testCloudAccountName , name , password ),
107100 Check : resource .ComposeAggregateTestCheckFunc (
108- resource .TestCheckResourceAttr (resourceName , "name" , "example-updated" ),
109- resource .TestCheckResourceAttr (resourceName , "protocol" , "redis" ),
110- resource .TestCheckResourceAttr (resourceName , "dataset_size_in_gb" , "1" ),
111- resource .TestCheckResourceAttr (resourceName , "replication" , "true" ),
112- resource .TestCheckResourceAttr (resourceName , "support_oss_cluster_api" , "true" ),
113- resource .TestCheckResourceAttr (resourceName , "resp_version" , "resp3" ),
114- resource .TestCheckResourceAttr (resourceName , "throughput_measurement_by" , "operations-per-second" ),
115- resource .TestCheckResourceAttr (resourceName , "throughput_measurement_value" , "2000" ),
116- resource .TestCheckResourceAttr (resourceName , "data_persistence" , "aof-every-write" ),
117- resource .TestCheckResourceAttr (resourceName , "data_eviction" , "volatile-lru" ),
118- resource .TestCheckResourceAttr (resourceName , "average_item_size_in_bytes" , "0" ),
119- resource .TestCheckResourceAttr (resourceName , "client_ssl_certificate" , "" ),
120- resource .TestCheckResourceAttr (resourceName , "periodic_backup_path" , "" ),
121- resource .TestCheckResourceAttr (resourceName , "external_endpoint_for_oss_cluster_api" , "true" ),
122- resource .TestCheckResourceAttr (resourceName , "password" , "updated-password" ),
123- resource .TestCheckResourceAttr (resourceName , "alert.#" , "1" ),
124- resource .TestCheckResourceAttr (resourceName , "alert.0.name" , "dataset-size" ),
125- resource .TestCheckResourceAttr (resourceName , "alert.0.value" , "80" ),
126- resource .TestCheckResourceAttr (resourceName , "enable_default_user" , "true" ),
127101 resource .TestCheckResourceAttr (resourceName , "redis_version" , "8.0" ),
128102 ),
129103 },
130- // Test that that database is imported successfully
131- {
132- ResourceName : "rediscloud_subscription_database.example" ,
133- ImportState : true ,
134- ImportStateVerify : true ,
135- },
136104 },
137105 })
138106}
@@ -163,9 +131,9 @@ func getRedis8DatabaseConfig(t *testing.T, cloudAccountName, subscriptionName, p
163131 return fmt .Sprintf (content , cloudAccountName , subscriptionName , password )
164132}
165133
166- func getRedis8DatabaseUpdateConfig (t * testing.T , cloudAccountName , subscriptionName string ) string {
134+ func getRedis8DatabaseUpdateConfig (t * testing.T , cloudAccountName , subscriptionName , password string ) string {
167135 content := utils .GetTestConfig (t , "./pro/testdata/pro_database_redis_8_update.tf" )
168- return fmt .Sprintf (content , cloudAccountName , subscriptionName )
136+ return fmt .Sprintf (content , cloudAccountName , subscriptionName , password )
169137}
170138
171139func getRedis8WithModulesConfig (t * testing.T , cloudAccountName , subscriptionName , password string ) string {
0 commit comments