@@ -562,7 +562,7 @@ func TestAccAliCloudClickHouseDBCluster_ClusterVersion(t *testing.T) {
562
562
})
563
563
}
564
564
565
- func TestAccAliCloudClickHouseDBCluster_UpdateClusterInplace (t * testing.T ) {
565
+ func TestAccAliCloudClickHouseDBCluster_UpdateClusterInplace1 (t * testing.T ) {
566
566
checkoutSupportedRegions (t , true , connectivity .VbrSupportRegions )
567
567
var v map [string ]interface {}
568
568
resourceId := "alicloud_click_house_db_cluster.default"
@@ -621,13 +621,61 @@ func TestAccAliCloudClickHouseDBCluster_UpdateClusterInplace(t *testing.T) {
621
621
}),
622
622
),
623
623
},
624
+ {
625
+ ResourceName : resourceId ,
626
+ ImportState : true ,
627
+ ImportStateVerify : true ,
628
+ },
629
+ },
630
+ })
631
+ }
632
+
633
+ func TestAccAliCloudClickHouseDBCluster_UpdateClusterInplace2 (t * testing.T ) {
634
+ checkoutSupportedRegions (t , true , connectivity .VodSupportRegions )
635
+ var v map [string ]interface {}
636
+ resourceId := "alicloud_click_house_db_cluster.default"
637
+ ra := resourceAttrInit (resourceId , AliCloudClickHouseDBClusterMap0 )
638
+ rc := resourceCheckInitWithDescribeMethod (resourceId , & v , func () interface {} {
639
+ return & ClickhouseService {testAccProvider .Meta ().(* connectivity.AliyunClient )}
640
+ }, "DescribeClickHouseDbCluster" )
641
+ rac := resourceAttrCheckInit (rc , ra )
642
+ testAccCheck := rac .resourceAttrMapUpdateSet ()
643
+ rand := acctest .RandIntRange (10000 , 99999 )
644
+ name := fmt .Sprintf ("tf-testacc%sclickhousedbcluster%d" , defaultRegionToTest , rand )
645
+ testAccConfig := resourceTestAccConfigFunc (resourceId , name , AliCloudClickHouseDBClusterBasicDependence0 )
646
+ resource .Test (t , resource.TestCase {
647
+ PreCheck : func () {
648
+ testAccPreCheck (t )
649
+ },
650
+ IDRefreshName : resourceId ,
651
+ Providers : testAccProviders ,
652
+ CheckDestroy : rac .checkResourceDestroy (),
653
+ Steps : []resource.TestStep {
624
654
{
625
655
Config : testAccConfig (map [string ]interface {}{
626
- "db_node_group_count" : "2" ,
656
+ "db_cluster_version" : "22.8.5.29" ,
657
+ "category" : "Basic" ,
658
+ "db_cluster_class" : "S8" ,
659
+ "db_cluster_network_type" : "vpc" ,
660
+ "db_node_group_count" : "1" ,
661
+ "payment_type" : "PayAsYouGo" ,
662
+ "db_node_storage" : "100" ,
663
+ "storage_type" : "cloud_essd" ,
664
+ "vpc_id" : "${alicloud_vswitch.default.vpc_id}" ,
665
+ "vswitch_id" : "${alicloud_vswitch.default.id}" ,
627
666
}),
628
667
Check : resource .ComposeTestCheckFunc (
629
668
testAccCheck (map [string ]string {
630
- "db_node_group_count" : "2" ,
669
+ "db_cluster_version" : "22.8.5.29" ,
670
+ "category" : "Basic" ,
671
+ "db_cluster_class" : "S8" ,
672
+ "db_cluster_network_type" : "vpc" ,
673
+ "db_node_group_count" : "1" ,
674
+ "payment_type" : "PayAsYouGo" ,
675
+ "db_node_storage" : "100" ,
676
+ "storage_type" : "cloud_essd" ,
677
+ "vswitch_id" : CHECKSET ,
678
+ "vpc_id" : CHECKSET ,
631
679
}),
632
680
),
633
681
},
@@ -650,6 +698,74 @@ func TestAccAliCloudClickHouseDBCluster_UpdateClusterInplace(t *testing.T) {
650
698
})
651
699
}
652
700
701
+ func TestAccAliCloudClickHouseDBCluster_UpdateClusterInplace3 (t * testing.T ) {
702
+ checkoutSupportedRegions (t , true , connectivity .VodSupportRegions )
703
+ var v map [string ]interface {}
704
+ resourceId := "alicloud_click_house_db_cluster.default"
705
+ ra := resourceAttrInit (resourceId , AliCloudClickHouseDBClusterMap0 )
706
+ rc := resourceCheckInitWithDescribeMethod (resourceId , & v , func () interface {} {
707
+ return & ClickhouseService {testAccProvider .Meta ().(* connectivity.AliyunClient )}
708
+ }, "DescribeClickHouseDbCluster" )
709
+ rac := resourceAttrCheckInit (rc , ra )
710
+ testAccCheck := rac .resourceAttrMapUpdateSet ()
711
+ rand := acctest .RandIntRange (10000 , 99999 )
712
+ name := fmt .Sprintf ("tf-testacc%sclickhousedbcluster%d" , defaultRegionToTest , rand )
713
+ testAccConfig := resourceTestAccConfigFunc (resourceId , name , AliCloudClickHouseDBClusterBasicDependence0 )
714
+ resource .Test (t , resource.TestCase {
715
+ PreCheck : func () {
716
+ testAccPreCheck (t )
717
+ },
718
+ IDRefreshName : resourceId ,
719
+ Providers : testAccProviders ,
720
+ CheckDestroy : rac .checkResourceDestroy (),
721
+ Steps : []resource.TestStep {
722
+ {
723
+ Config : testAccConfig (map [string ]interface {}{
724
+ "db_cluster_version" : "22.8.5.29" ,
725
+ "category" : "Basic" ,
726
+ "db_cluster_class" : "S8" ,
727
+ "db_cluster_network_type" : "vpc" ,
728
+ "db_node_group_count" : "1" ,
729
+ "payment_type" : "PayAsYouGo" ,
730
+ "db_node_storage" : "100" ,
731
+ "storage_type" : "cloud_essd" ,
732
+ "vpc_id" : "${alicloud_vswitch.default.vpc_id}" ,
733
+ "vswitch_id" : "${alicloud_vswitch.default.id}" ,
734
+ }),
735
+ Check : resource .ComposeTestCheckFunc (
736
+ testAccCheck (map [string ]string {
737
+ "db_cluster_version" : "22.8.5.29" ,
738
+ "category" : "Basic" ,
739
+ "db_cluster_class" : "S8" ,
740
+ "db_cluster_network_type" : "vpc" ,
741
+ "db_node_group_count" : "1" ,
742
+ "payment_type" : "PayAsYouGo" ,
743
+ "db_node_storage" : "100" ,
744
+ "storage_type" : "cloud_essd" ,
745
+ "vswitch_id" : CHECKSET ,
746
+ "vpc_id" : CHECKSET ,
747
+ }),
748
+ ),
749
+ },
750
+ {
751
+ Config : testAccConfig (map [string ]interface {}{
752
+ "db_node_group_count" : "2" ,
753
+ }),
754
+ Check : resource .ComposeTestCheckFunc (
755
+ testAccCheck (map [string ]string {
756
+ "db_node_group_count" : "2" ,
757
+ }),
758
+ ),
759
+ },
760
+ {
761
+ ResourceName : resourceId ,
762
+ ImportState : true ,
763
+ ImportStateVerify : true ,
764
+ },
765
+ },
766
+ })
767
+ }
768
+
653
769
func TestAccAliCloudClickHouseDBCluster_AutoRenew (t * testing.T ) {
654
770
checkoutSupportedRegions (t , true , connectivity .VbrSupportRegions )
655
771
var v map [string ]interface {}
0 commit comments