@@ -15,7 +15,7 @@ import (
15
15
matlas "go.mongodb.org/atlas/mongodbatlas"
16
16
)
17
17
18
- func TestAccResourceMongoDBAtlasCluster_basicAWS (t * testing.T ) {
18
+ func TestAccResourceMongoDBAtlasCluster_basicAWS_simple (t * testing.T ) {
19
19
var (
20
20
cluster matlas.Cluster
21
21
resourceName = "mongodbatlas_cluster.test"
@@ -61,7 +61,6 @@ func TestAccResourceMongoDBAtlasCluster_basicAWS(t *testing.T) {
61
61
}
62
62
63
63
func TestAccResourceMongoDBAtlasCluster_basicAWS_instanceScale (t * testing.T ) {
64
- SkipTest (t ) // Skipped for now because of paramater provider_disk_iops breaks the terraform flow
65
64
var (
66
65
cluster matlas.Cluster
67
66
resourceName = "mongodbatlas_cluster.test"
@@ -75,33 +74,25 @@ func TestAccResourceMongoDBAtlasCluster_basicAWS_instanceScale(t *testing.T) {
75
74
CheckDestroy : testAccCheckMongoDBAtlasClusterDestroy ,
76
75
Steps : []resource.TestStep {
77
76
{
78
- Config : testAccMongoDBAtlasClusterConfigAWS (projectID , name , true , false ),
77
+ Config : testAccMongoDBAtlasClusterConfigAWSNVMEInstance (projectID , name , "M40_NVME" ),
79
78
Check : resource .ComposeTestCheckFunc (
80
79
testAccCheckMongoDBAtlasClusterExists (resourceName , & cluster ),
81
80
testAccCheckMongoDBAtlasClusterAttributes (& cluster , name ),
82
81
resource .TestCheckResourceAttrSet (resourceName , "project_id" ),
83
82
resource .TestCheckResourceAttr (resourceName , "name" , name ),
84
- resource .TestCheckResourceAttr (resourceName , "disk_size_gb" , "100" ),
85
- resource .TestCheckResourceAttr (resourceName , "pit_enabled" , "true" ),
83
+ resource .TestCheckResourceAttr (resourceName , "provider_instance_size_name" , "M40_NVME" ),
86
84
resource .TestCheckResourceAttrSet (resourceName , "mongo_uri" ),
87
- resource .TestCheckResourceAttrSet (resourceName , "replication_specs.#" ),
88
- resource .TestCheckResourceAttrSet (resourceName , "replication_specs.0.regions_config.#" ),
89
85
),
90
86
},
91
87
{
92
- Config : testAccMongoDBAtlasClusterConfigAWSNVMEInstance (projectID , name , "true " ),
88
+ Config : testAccMongoDBAtlasClusterConfigAWSNVMEInstance (projectID , name , "M50_NVME " ),
93
89
Check : resource .ComposeTestCheckFunc (
94
90
testAccCheckMongoDBAtlasClusterExists (resourceName , & cluster ),
95
91
testAccCheckMongoDBAtlasClusterAttributes (& cluster , name ),
96
92
resource .TestCheckResourceAttrSet (resourceName , "project_id" ),
97
93
resource .TestCheckResourceAttr (resourceName , "name" , name ),
98
- resource .TestCheckResourceAttr (resourceName , "disk_size_gb" , "100" ),
99
- resource .TestCheckResourceAttr (resourceName , "pit_enabled" , "true" ),
100
- resource .TestCheckResourceAttr (resourceName , "provider_backup_enabled" , "true" ),
101
- resource .TestCheckResourceAttr (resourceName , "provider_instance_size_name" , "M40_NVME" ),
94
+ resource .TestCheckResourceAttr (resourceName , "provider_instance_size_name" , "M50_NVME" ),
102
95
resource .TestCheckResourceAttrSet (resourceName , "mongo_uri" ),
103
- resource .TestCheckResourceAttrSet (resourceName , "replication_specs.#" ),
104
- resource .TestCheckResourceAttrSet (resourceName , "replication_specs.0.regions_config.#" ),
105
96
),
106
97
},
107
98
},
@@ -1189,7 +1180,6 @@ func testAccMongoDBAtlasClusterConfigAWS(projectID, name string, backupEnabled,
1189
1180
project_id = "%[1]s"
1190
1181
name = "%[2]s"
1191
1182
disk_size_gb = 100
1192
-
1193
1183
cluster_type = "REPLICASET"
1194
1184
replication_specs {
1195
1185
num_shards = 1
@@ -1200,47 +1190,33 @@ func testAccMongoDBAtlasClusterConfigAWS(projectID, name string, backupEnabled,
1200
1190
read_only_nodes = 0
1201
1191
}
1202
1192
}
1203
-
1204
1193
cloud_backup = %[3]t
1205
1194
pit_enabled = %[3]t
1206
1195
auto_scaling_disk_gb_enabled = %[4]t
1207
1196
mongo_db_major_version = "4.0"
1208
-
1209
1197
// Provider Settings "block"
1198
+
1210
1199
provider_name = "AWS"
1211
1200
provider_instance_size_name = "M30"
1212
1201
}
1213
1202
` , projectID , name , backupEnabled , autoDiskGBEnabled )
1214
1203
}
1215
1204
1216
- func testAccMongoDBAtlasClusterConfigAWSNVMEInstance (projectID , name , backupEnabled string ) string {
1205
+ func testAccMongoDBAtlasClusterConfigAWSNVMEInstance (projectID , name , instanceName string ) string {
1217
1206
return fmt .Sprintf (`
1218
1207
resource "mongodbatlas_cluster" "test" {
1219
1208
project_id = "%[1]s"
1220
1209
name = "%[2]s"
1221
- disk_size_gb = 100
1222
-
1223
- cluster_type = "REPLICASET"
1224
- replication_specs {
1225
- num_shards = 1
1226
- regions_config {
1227
- region_name = "EU_CENTRAL_1"
1228
- electable_nodes = 3
1229
- priority = 7
1230
- read_only_nodes = 0
1231
- }
1232
- }
1233
-
1234
- provider_backup_enabled = %[3]s
1235
- pit_enabled = %[3]s
1236
- mongo_db_major_version = "4.0"
1237
1210
1211
+ cloud_backup = true
1212
+ mongo_db_major_version = "4.4"
1238
1213
// Provider Settings "block"
1214
+ provider_region_name = "US_EAST_1"
1239
1215
provider_name = "AWS"
1216
+ provider_instance_size_name = "%[3]s"
1240
1217
provider_volume_type = "PROVISIONED"
1241
- provider_instance_size_name = "M40_NVME"
1242
1218
}
1243
- ` , projectID , name , backupEnabled )
1219
+ ` , projectID , name , instanceName )
1244
1220
}
1245
1221
1246
1222
func testAccMongoDBAtlasClusterConfigAdvancedConf (projectID , name , autoscalingEnabled string , p * matlas.ProcessArgs ) string {
0 commit comments