@@ -166,6 +166,7 @@ func TestAccMockableAdvancedCluster_tenantUpgrade(t *testing.T) {
166
166
Config : acc .ConvertAdvancedClusterToSchemaV2 (t , true , configTenantUpgraded (projectID , clusterName , defaultZoneName )),
167
167
Check : checksTenantUpgraded (projectID , clusterName ),
168
168
},
169
+ acc .TestStepImportCluster (resourceName ),
169
170
},
170
171
})
171
172
}
@@ -358,6 +359,7 @@ func TestAccClusterAdvancedCluster_advancedConfig_oldMongoDBVersion(t *testing.T
358
359
Config : configAdvanced (t , true , projectID , clusterName , "6.0" , processArgs20240530 , processArgsCipherConfig ),
359
360
Check : checkAdvanced (true , clusterName , "TLS1_2" , processArgsCipherConfig ),
360
361
},
362
+ acc .TestStepImportCluster (resourceName ),
361
363
},
362
364
})
363
365
}
@@ -425,6 +427,7 @@ func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) {
425
427
Config : configAdvanced (t , true , projectID , clusterNameUpdated , "" , processArgs20240530Updated , processArgsUpdatedCipherConfig ),
426
428
Check : checkAdvanced (true , clusterNameUpdated , "TLS1_2" , processArgsUpdatedCipherConfig ),
427
429
},
430
+ acc .TestStepImportCluster (resourceName ),
428
431
},
429
432
})
430
433
}
@@ -469,6 +472,7 @@ func TestAccClusterAdvancedCluster_defaultWrite(t *testing.T) {
469
472
Config : configAdvancedDefaultWrite (t , true , projectID , clusterNameUpdated , processArgsUpdated ),
470
473
Check : checkAdvancedDefaultWrite (true , clusterNameUpdated , "majority" , "TLS1_2" ),
471
474
},
475
+ acc .TestStepImportCluster (resourceName ),
472
476
},
473
477
})
474
478
}
@@ -511,6 +515,7 @@ func TestAccClusterAdvancedClusterConfig_replicationSpecsAutoScaling(t *testing.
511
515
acc .TestCheckResourceAttrSchemaV2 (true , resourceName , "replication_specs.0.region_configs.0.auto_scaling.0.compute_enabled" , "true" ),
512
516
),
513
517
},
518
+ acc .TestStepImportCluster (resourceName ),
514
519
},
515
520
})
516
521
}
@@ -552,6 +557,7 @@ func TestAccClusterAdvancedClusterConfig_replicationSpecsAnalyticsAutoScaling(t
552
557
acc .TestCheckResourceAttrSchemaV2 (true , resourceName , "replication_specs.0.region_configs.0.analytics_auto_scaling.0.compute_enabled" , "true" ),
553
558
),
554
559
},
560
+ acc .TestStepImportCluster (resourceName ),
555
561
},
556
562
})
557
563
}
@@ -568,6 +574,7 @@ func TestAccClusterAdvancedClusterConfig_singleShardedTransitionToOldSchemaExpec
568
574
Config : configGeoShardedOldSchema (t , true , projectID , clusterName , 1 , 1 , false ),
569
575
Check : checkGeoShardedOldSchema (true , clusterName , 1 , 1 , true , true ),
570
576
},
577
+ acc .TestStepImportCluster (resourceName ),
571
578
{
572
579
Config : configGeoShardedOldSchema (t , true , projectID , clusterName , 1 , 2 , false ),
573
580
ExpectError : regexp .MustCompile (advancedcluster .ErrorOperationNotPermitted ),
@@ -600,6 +607,7 @@ func TestAccClusterAdvancedCluster_withTags(t *testing.T) {
600
607
Config : configWithKeyValueBlocks (t , true , orgID , projectName , clusterName , "tags" , acc .ClusterTagsMap3 ),
601
608
Check : checkKeyValueBlocks (true , true , "tags" , acc .ClusterTagsMap3 ),
602
609
},
610
+ acc .TestStepImportCluster (resourceName ),
603
611
},
604
612
})
605
613
}
@@ -628,6 +636,7 @@ func TestAccClusterAdvancedCluster_withLabels(t *testing.T) {
628
636
Config : configWithKeyValueBlocks (t , true , orgID , projectName , clusterName , "labels" , acc .ClusterLabelsMap3 ),
629
637
Check : checkKeyValueBlocks (true , true , "labels" , acc .ClusterLabelsMap3 ),
630
638
},
639
+ acc .TestStepImportCluster (resourceName ),
631
640
},
632
641
})
633
642
}
@@ -671,6 +680,7 @@ func TestAccClusterAdvancedClusterConfig_selfManagedSharding(t *testing.T) {
671
680
Check : resource .ComposeAggregateTestCheckFunc (checks ... ,
672
681
),
673
682
},
683
+ acc .TestStepImportCluster (resourceName ),
674
684
{
675
685
Config : configGeoShardedOldSchema (t , true , projectID , clusterName , 1 , 1 , false ),
676
686
ExpectError : regexp .MustCompile ("CANNOT_MODIFY_GLOBAL_CLUSTER_MANAGEMENT_SETTING" ),
@@ -715,6 +725,7 @@ func TestAccMockableAdvancedCluster_symmetricShardedOldSchema(t *testing.T) {
715
725
Config : configShardedOldSchemaMultiCloud (t , true , projectID , clusterName , 2 , "M20" , & configServerManagementModeAtlasManaged ),
716
726
Check : checkShardedOldSchemaMultiCloud (true , clusterName , 2 , "M20" , false , & configServerManagementModeAtlasManaged ),
717
727
},
728
+ acc .TestStepImportCluster (resourceName , "replication_specs" ), // Import with old schema will NOT use `num_shards`
718
729
},
719
730
})
720
731
}
@@ -744,6 +755,7 @@ func symmetricGeoShardedOldSchemaTestCase(t *testing.T, isAcc bool) resource.Tes
744
755
checkGeoShardedOldSchema (isAcc , clusterName , 3 , 3 , true , false ),
745
756
acc .CheckIndependentShardScalingMode (resourceName , clusterName , "CLUSTER" )),
746
757
},
758
+ acc .TestStepImportCluster (resourceName , "replication_specs" ), // Import with old schema will NOT use `num_shards`
747
759
},
748
760
}
749
761
}
@@ -764,6 +776,7 @@ func TestAccMockableAdvancedCluster_symmetricShardedOldSchemaDiskSizeGBAtElectab
764
776
Config : configShardedOldSchemaDiskSizeGBElectableLevel (t , true , projectID , clusterName , 55 ),
765
777
Check : checkShardedOldSchemaDiskSizeGBElectableLevel (true , 55 ),
766
778
},
779
+ acc .TestStepImportCluster (resourceName , "replication_specs" ), // Import with old schema will NOT use `num_shards`
767
780
},
768
781
})
769
782
}
@@ -792,6 +805,7 @@ func TestAccClusterAdvancedClusterConfig_symmetricShardedNewSchemaToAsymmetricAd
792
805
Config : configShardedNewSchema (t , true , orgID , projectName , clusterName , 55 , "M10" , "M20" , nil , nil , false , false ), // removes middle replication spec
793
806
Check : checkShardedNewSchema (true , 55 , "M10" , "M20" , nil , nil , true , false ),
794
807
},
808
+ acc .TestStepImportCluster (resourceName ),
795
809
},
796
810
})
797
811
}
@@ -820,6 +834,7 @@ func asymmetricShardedNewSchemaTestCase(t *testing.T, isAcc bool) resource.TestC
820
834
resource .TestCheckResourceAttr ("data.mongodbatlas_advanced_clusters.test-replication-specs-per-shard-false" , "results.#" , "0" ),
821
835
acc .CheckIndependentShardScalingMode (resourceName , clusterName , "SHARD" )),
822
836
},
837
+ acc .TestStepImportCluster (resourceName ),
823
838
},
824
839
}
825
840
}
@@ -863,6 +878,7 @@ func TestAccClusterAdvancedClusterConfig_asymmetricGeoShardedNewSchemaAddingRemo
863
878
Config : configGeoShardedNewSchema (t , true , projectID , clusterName , false ),
864
879
Check : checkGeoShardedNewSchema (true , false ),
865
880
},
881
+ acc .TestStepImportCluster (resourceName ),
866
882
},
867
883
})
868
884
}
@@ -885,6 +901,7 @@ func TestAccClusterAdvancedClusterConfig_shardedTransitionFromOldToNewSchema(t *
885
901
Config : configShardedTransitionOldToNewSchema (t , true , projectID , clusterName , true , false ),
886
902
Check : checkShardedTransitionOldToNewSchema (true , true ),
887
903
},
904
+ acc .TestStepImportCluster (resourceName ),
888
905
},
889
906
})
890
907
}
@@ -905,6 +922,7 @@ func TestAccClusterAdvancedClusterConfig_geoShardedTransitionFromOldToNewSchema(
905
922
Config : configGeoShardedTransitionOldToNewSchema (t , true , projectID , clusterName , true ),
906
923
Check : checkGeoShardedTransitionOldToNewSchema (true , true ),
907
924
},
925
+ acc .TestStepImportCluster (resourceName ),
908
926
},
909
927
})
910
928
}
@@ -937,6 +955,7 @@ func TestAccAdvancedCluster_replicaSetScalingStrategyAndRedactClientLogData(t *t
937
955
Config : configReplicaSetScalingStrategyAndRedactClientLogData (t , true , orgID , projectName , clusterName , "NODE_TYPE" , false ),
938
956
Check : checkReplicaSetScalingStrategyAndRedactClientLogData (true , "NODE_TYPE" , false ),
939
957
},
958
+ acc .TestStepImportCluster (resourceName ),
940
959
},
941
960
})
942
961
}
@@ -965,6 +984,7 @@ func TestAccAdvancedCluster_replicaSetScalingStrategyAndRedactClientLogDataOldSc
965
984
Config : configReplicaSetScalingStrategyAndRedactClientLogDataOldSchema (t , true , orgID , projectName , clusterName , "NODE_TYPE" , false ),
966
985
Check : checkReplicaSetScalingStrategyAndRedactClientLogData (true , "NODE_TYPE" , false ),
967
986
},
987
+ acc .TestStepImportCluster (resourceName , "replication_specs" ), // Import with old schema will NOT use `num_shards`
968
988
},
969
989
})
970
990
}
@@ -994,6 +1014,7 @@ func TestAccClusterAdvancedCluster_priorityOldSchema(t *testing.T) {
994
1014
Config : configPriority (t , true , projectID , clusterName , true , false ),
995
1015
Check : acc .TestCheckResourceAttrSchemaV2 (true , resourceName , "replication_specs.0.region_configs.#" , "2" ),
996
1016
},
1017
+ acc .TestStepImportCluster (resourceName , "replication_specs" ), // Import with old schema will NOT use `num_shards`
997
1018
},
998
1019
})
999
1020
}
@@ -1044,6 +1065,7 @@ func TestAccClusterAdvancedCluster_biConnectorConfig(t *testing.T) {
1044
1065
Config : configBiConnectorConfig (t , true , projectID , clusterName , true ),
1045
1066
Check : checkTenantBiConnectorConfig (true , projectID , clusterName , true ),
1046
1067
},
1068
+ acc .TestStepImportCluster (resourceName ),
1047
1069
},
1048
1070
})
1049
1071
}
@@ -1096,6 +1118,7 @@ func TestAccClusterAdvancedCluster_pinnedFCVWithVersionUpgradeAndDowngrade(t *te
1096
1118
Config : configFCVPinning (t , orgID , projectName , clusterName , nil , "7.0" ),
1097
1119
Check : acc .CheckFCVPinningConfig (true , resourceName , dataSourceName , dataSourcePluralName , 7 , nil , nil ),
1098
1120
},
1121
+ acc .TestStepImportCluster (resourceName ),
1099
1122
},
1100
1123
})
1101
1124
}
@@ -1116,6 +1139,7 @@ func TestAccAdvancedCluster_oldToNewSchemaWithAutoscalingEnabled(t *testing.T) {
1116
1139
Config : configShardedTransitionOldToNewSchema (t , true , projectID , clusterName , true , true ),
1117
1140
Check : acc .CheckIndependentShardScalingMode (resourceName , clusterName , "SHARD" ),
1118
1141
},
1142
+ acc .TestStepImportCluster (resourceName ),
1119
1143
},
1120
1144
})
1121
1145
}
@@ -1140,6 +1164,7 @@ func TestAccAdvancedCluster_oldToNewSchemaWithAutoscalingDisabledToEnabled(t *te
1140
1164
Config : configShardedTransitionOldToNewSchema (t , true , projectID , clusterName , true , true ),
1141
1165
Check : acc .CheckIndependentShardScalingMode (resourceName , clusterName , "SHARD" ),
1142
1166
},
1167
+ acc .TestStepImportCluster (resourceName ),
1143
1168
},
1144
1169
})
1145
1170
}
0 commit comments