Skip to content

Commit

Permalink
refactor: use advanced_cluster instead of cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenAlbert committed Jul 8, 2024
1 parent 2288b94 commit 70dbbc1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,41 +273,65 @@ const (
replication_specs {
zone_name = "US"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "US_EAST_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
replication_specs {
zone_name = "EU"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "EU_WEST_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
replication_specs {
zone_name = "DE"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "EU_NORTH_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
replication_specs {
zone_name = "JP"
num_shards = 1
regions_config {
region_configs {
auto_scaling {
disk_gb_enabled = false
}
region_name = "AP_NORTHEAST_1"
electable_nodes = 3
provider_name = "AWS"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
`
Expand Down
28 changes: 16 additions & 12 deletions internal/testutil/acc/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,27 @@ func GetClusterInfo(tb testing.TB, req *ClusterRequest) ClusterInfo {
`, req.ResourceDependencyName)
}
clusterTerraformStr := fmt.Sprintf(`
resource "mongodbatlas_cluster" "test_cluster" {
resource "mongodbatlas_advanced_cluster" "test_cluster" {
project_id = %[1]q
name = %[2]q
cloud_backup = %[3]t
auto_scaling_disk_gb_enabled = false
provider_name = %[4]q
provider_instance_size_name = "M10"
cluster_type = %[5]q
backup_enabled = %[3]t
cluster_type = %[5]q
replication_specs {
num_shards = 1
zone_name = "Zone 1"
regions_config {
region_name = "US_WEST_2"
electable_nodes = 3
region_configs {
auto_scaling {
disk_gb_enabled = false
}
provider_name = %[4]q
region_name = "US_WEST_2"
priority = 7
read_only_nodes = 0
electable_specs {
instance_size = "M10"
node_count = 3
}
}
}
%[6]s
Expand All @@ -88,7 +92,7 @@ func GetClusterInfo(tb testing.TB, req *ClusterRequest) ClusterInfo {
ProjectIDStr: fmt.Sprintf("%q", projectID),
ProjectID: projectID,
ClusterName: clusterName,
ClusterNameStr: "mongodbatlas_cluster.test_cluster.name",
ClusterNameStr: "mongodbatlas_advanced_cluster.test_cluster.name",
ClusterTerraformStr: clusterTerraformStr,
}
}
Expand Down

0 comments on commit 70dbbc1

Please sign in to comment.