@@ -17,13 +17,10 @@ func TestAccResourceRedisCloudActiveActivePrivateLink_CRUDI(t *testing.T) {
1717
1818 password := acctest .RandString (20 )
1919
20- principal1 := "123456789012"
21- principal2 := "234567890123"
22-
2320 const resourceName = "rediscloud_private_link.private_link"
2421 const datasourceName = "data.rediscloud_private_link.private_link"
2522 shareName := acctest .RandomWithPrefix (testResourcePrefix ) + "privatelink-active-active_test-share"
26- terraformConfig := getRedisActiveActivePrivateLinkConfig (t , testActiveActivePrivateLinkConfigFile , shareName , password , principal1 , principal2 )
23+ terraformConfig := getRedisActiveActivePrivateLinkConfig (t , testActiveActivePrivateLinkConfigFile , shareName , password )
2724
2825 resource .ParallelTest (t , resource.TestCase {
2926 PreCheck : func () { testAccPreCheck (t ) },
@@ -35,23 +32,25 @@ func TestAccResourceRedisCloudActiveActivePrivateLink_CRUDI(t *testing.T) {
3532 Check : resource .ComposeAggregateTestCheckFunc (
3633 resource .TestCheckResourceAttrSet (resourceName , "id" ),
3734 resource .TestCheckResourceAttrSet (resourceName , "subscription_id" ),
38- resource .TestCheckResourceAttr (resourceName , "share_name" , shareName ),
39- resource .TestCheckResourceAttrSet (resourceName , "principal" ),
35+ resource .TestCheckResourceAttrSet (resourceName , "share_name" ),
36+ resource .TestCheckResourceAttrSet (resourceName , "region_id" ),
37+ resource .TestCheckResourceAttr (resourceName , "principal.#" , "2" ),
4038 resource .TestCheckResourceAttrSet (resourceName , "resource_configuration_id" ),
4139 resource .TestCheckResourceAttrSet (resourceName , "resource_configuration_arn" ),
4240 resource .TestCheckResourceAttrSet (resourceName , "share_arn" ),
43- resource .TestCheckResourceAttrSet (resourceName , "connections" ),
44- resource .TestCheckResourceAttrSet (resourceName , "databases" ),
41+ resource .TestCheckResourceAttr (resourceName , "connections.#" , "0 " ),
42+ resource .TestCheckResourceAttr (resourceName , "databases.#" , "1 " ),
4543
4644 resource .TestCheckResourceAttrSet (datasourceName , "id" ),
4745 resource .TestCheckResourceAttrSet (datasourceName , "subscription_id" ),
48- resource .TestCheckResourceAttr (datasourceName , "share_name" , shareName ),
49- resource .TestCheckResourceAttrSet (datasourceName , "principal" ),
46+ resource .TestCheckResourceAttrSet (datasourceName , "region_id" ),
47+ resource .TestCheckResourceAttr (datasourceName , "principals.#" , "2" ),
48+
5049 resource .TestCheckResourceAttrSet (datasourceName , "resource_configuration_id" ),
5150 resource .TestCheckResourceAttrSet (datasourceName , "resource_configuration_arn" ),
5251 resource .TestCheckResourceAttrSet (datasourceName , "share_arn" ),
53- resource .TestCheckResourceAttrSet (datasourceName , "connections" ),
54- resource .TestCheckResourceAttrSet (datasourceName , "databases" ),
52+ resource .TestCheckResourceAttr (datasourceName , "connections.#" , "0 " ),
53+ resource .TestCheckResourceAttr (datasourceName , "databases.#" , "1 " ),
5554 ),
5655 },
5756 {
@@ -63,7 +62,7 @@ func TestAccResourceRedisCloudActiveActivePrivateLink_CRUDI(t *testing.T) {
6362 })
6463}
6564
66- func getRedisActiveActivePrivateLinkConfig (t * testing.T , testFile , shareName , password , principal1 , principal2 string ) string {
65+ func getRedisActiveActivePrivateLinkConfig (t * testing.T , testFile , shareName , password string ) string {
6766 subName := acctest .RandomWithPrefix (testResourcePrefix ) + "-aa-private-link"
6867 exampleCloudAccountName := os .Getenv ("AWS_TEST_CLOUD_ACCOUNT_NAME" )
6968
@@ -72,5 +71,5 @@ func getRedisActiveActivePrivateLinkConfig(t *testing.T, testFile, shareName, pa
7271 t .Fatalf ("failed to read file: %v" , err )
7372 }
7473
75- return fmt .Sprintf (string (content ), subName , exampleCloudAccountName , shareName , password , principal1 , principal2 )
74+ return fmt .Sprintf (string (content ), subName , exampleCloudAccountName , shareName , password )
7675}
0 commit comments