@@ -36,7 +36,7 @@ func TestAccResourceRedisCloudActiveActiveSubscription_CRUDI(t *testing.T) {
3636 CheckDestroy : testAccCheckActiveActiveSubscriptionDestroy ,
3737 Steps : []resource.TestStep {
3838 {
39- Config : fmt .Sprintf (testAccResourceRedisCloudActiveActiveSubscription , name ),
39+ Config : fmt .Sprintf (testAccResourceRedisCloudActiveActiveSubscription , name , name ),
4040 Check : resource .ComposeAggregateTestCheckFunc (
4141 // Test the resource
4242 resource .TestCheckResourceAttr (resourceName , "name" , name ),
@@ -163,9 +163,11 @@ func TestAccResourceRedisCloudActiveActiveSubscription_CRUDI(t *testing.T) {
163163 // Test the region datasource
164164
165165 resource .TestCheckResourceAttr (datasourceRegionName , "subscription_name" , name ),
166+ resource .TestCheckResourceAttrSet (datasourceRegionName , "regions.0.regionId" ),
166167 resource .TestCheckResourceAttr (datasourceRegionName , "regions.0.region" , "us-east-1" ),
167168 resource .TestCheckResourceAttr (datasourceRegionName , "regions.0.networking_deployment_cidr" , "192.168.0.0/24" ),
168169 resource .TestCheckResourceAttrSet (datasourceRegionName , "regions.0.vpc_id" ),
170+ resource .TestCheckResourceAttrSet (datasourceRegionName , "regions.1.regionId" ),
169171 resource .TestCheckResourceAttr (datasourceRegionName , "regions.1.region" , "us-east-2" ),
170172 resource .TestCheckResourceAttr (datasourceRegionName , "regions.1.networking_deployment_cidr" , "10.0.1.0/24" ),
171173 resource .TestCheckResourceAttrSet (datasourceRegionName , "regions.1.vpc_id" ),
@@ -340,43 +342,79 @@ data "rediscloud_payment_method" "card" {
340342}
341343
342344resource "rediscloud_active_active_subscription" "example" {
343- name = "%s"
344- payment_method_id = data.rediscloud_payment_method.card.id
345- cloud_provider = "AWS"
345+ name = "%s"
346+ payment_method_id = data.rediscloud_payment_method.card.id
347+ cloud_provider = "AWS"
346348
347- creation_plan {
348- memory_limit_in_gb = 1
349- modules = ["RedisJSON"]
350- quantity = 1
351- region {
352- region = "us-east-1"
353- networking_deployment_cidr = "192.168.0.0/24"
354- write_operations_per_second = 1000
355- read_operations_per_second = 1000
356- }
357- region {
358- region = "us-east-2"
359- networking_deployment_cidr = "10.0.1.0/24"
360- write_operations_per_second = 1000
361- read_operations_per_second = 1000
362- }
363- }
349+ creation_plan {
350+ memory_limit_in_gb = 1
351+ modules = ["RedisJSON"]
352+ quantity = 1
353+ region {
354+ region = "us-east-1"
355+ networking_deployment_cidr = "192.168.0.0/24"
356+ write_operations_per_second = 1000
357+ read_operations_per_second = 1000
358+ }
359+ region {
360+ region = "us-east-2"
361+ networking_deployment_cidr = "10.0.1.0/24"
362+ write_operations_per_second = 1000
363+ read_operations_per_second = 1000
364+ }
365+ }
364366
365- maintenance_windows {
366- mode = "manual"
367- window {
368- start_hour = 22
369- duration_in_hours = 8
370- days = ["Monday", "Thursday"]
371- }
372- window {
373- start_hour = 12
374- duration_in_hours = 6
375- days = ["Friday", "Saturday", "Sunday"]
376- }
377- }
367+ maintenance_windows {
368+ mode = "manual"
369+ window {
370+ start_hour = 22
371+ duration_in_hours = 8
372+ days = ["Monday", "Thursday"]
373+ }
374+ window {
375+ start_hour = 12
376+ duration_in_hours = 6
377+ days = ["Friday", "Saturday", "Sunday"]
378+ }
379+ }
378380}
379381
382+ resource "rediscloud_active_active_subscription_database" "example" {
383+ subscription_id = rediscloud_active_active_subscription.example.id
384+ name = "%s"
385+ dataset_size_in_gb = 1
386+ global_data_persistence = "aof-every-1-second"
387+ global_password = "some-random-pass-2"
388+ global_source_ips = ["192.168.0.0/16"]
389+ global_alert {
390+ name = "dataset-size"
391+ value = 40
392+ }
393+
394+ global_modules = ["RedisJSON"]
395+
396+ override_region {
397+ name = "us-east-2"
398+ override_global_source_ips = ["192.10.0.0/16"]
399+ }
400+
401+ override_region {
402+ name = "us-east-1"
403+ override_global_data_persistence = "none"
404+ override_global_password = "region-specific-password"
405+ override_global_alert {
406+ name = "dataset-size"
407+ value = 60
408+ }
409+ }
410+
411+ tags = {
412+ "environment" = "production"
413+ "cost_center" = "0700"
414+ }
415+ }
416+
417+
380418data "rediscloud_active_active_subscription" "example" {
381419 name = rediscloud_active_active_subscription.example.name
382420}
0 commit comments