-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Convert multi replication specs multi regions advanced clusters #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
85edb57
09da628
7dd88fc
8e713dc
4ec05c3
983259c
5e60e8a
d946b52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ | ||
"configuration_file_error": "failed to parse Terraform config file" | ||
"configuration_file_error": "failed to parse Terraform config file", | ||
"replication_specs_missing_region_configs": "replication_specs must have at least one region_configs", | ||
"missing_replication_specs": "must have at least one replication_specs" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resource "mongodbatlas_advanced_cluster" "this" { | ||
project_id = "<YOUR-PROJECT-ID>" | ||
name = "flex-cluster" | ||
cluster_type = "REPLICASET" | ||
|
||
replication_specs { | ||
region_configs { | ||
provider_name = "FLEX" | ||
backing_provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "mongodbatlas_advanced_cluster" "this" { | ||
project_id = "<YOUR-PROJECT-ID>" | ||
name = "flex-cluster" | ||
cluster_type = "REPLICASET" | ||
|
||
replication_specs = [ | ||
{ | ||
region_configs = [ | ||
{ | ||
provider_name = "FLEX" | ||
backing_provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
} | ||
] | ||
} | ||
] | ||
|
||
# Updated by atlas-cli-plugin-terraform, please review the changes. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
resource "mongodbatlas_advanced_cluster" "no_replication_specs" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in all the examples I noticed we don't use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same question applies to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct, the next PR is precisely about removing num_shards and disk_size_gb. i prefer to do smaller more focused PRs |
||
# missing replication_specs | ||
project_id = var.project_id | ||
name = "cluster-multi-region" | ||
cluster_type = "REPLICASET" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
resource "mongodbatlas_advanced_cluster" "multi_region" { | ||
project_id = var.project_id | ||
name = "cluster-multi-region" | ||
cluster_type = "REPLICASET" | ||
backup_enabled = true | ||
|
||
replication_specs { | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_specs = { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 100 | ||
} | ||
} | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_WEST_2" | ||
priority = 6 | ||
electable_specs = { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 100 | ||
} | ||
} | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_WEST_1" | ||
priority = 5 | ||
electable_specs = { | ||
node_count = 1 | ||
instance_size = "M10" | ||
disk_size_gb = 100 | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
resource "mongodbatlas_advanced_cluster" "multi_region" { | ||
project_id = var.project_id | ||
name = "cluster-multi-region" | ||
cluster_type = "REPLICASET" | ||
backup_enabled = true | ||
|
||
replication_specs = [ | ||
{ | ||
region_configs = [ | ||
{ | ||
provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_specs = { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 100 | ||
} | ||
}, | ||
{ | ||
provider_name = "AWS" | ||
region_name = "US_WEST_2" | ||
priority = 6 | ||
electable_specs = { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 100 | ||
} | ||
}, | ||
{ | ||
provider_name = "AWS" | ||
region_name = "US_WEST_1" | ||
priority = 5 | ||
electable_specs = { | ||
node_count = 1 | ||
instance_size = "M10" | ||
disk_size_gb = 100 | ||
} | ||
} | ||
] | ||
} | ||
] | ||
|
||
# Updated by atlas-cli-plugin-terraform, please review the changes. | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
resource "mongodbatlas_advanced_cluster" "multirep" { | ||
project_id = var.project_id | ||
name = "multirep" | ||
cluster_type = "GEOSHARDED" | ||
backup_enabled = false | ||
replication_specs { | ||
zone_name = "Zone 1" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
replication_specs { | ||
zone_name = "Zone 2" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_WEST_2" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource "mongodbatlas_advanced_cluster" "geo" { | ||
project_id = var.project_id | ||
name = "geo" | ||
cluster_type = "GEOSHARDED" | ||
backup_enabled = false | ||
replication_specs { | ||
zone_name = "Zone 1" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
replication_specs { | ||
zone_name = "Zone 1" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
replication_specs { | ||
zone_name = "Zone 2" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_WEST_2" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
replication_specs { | ||
zone_name = "Zone 2" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_WEST_2" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
replication_specs { | ||
zone_name = "Zone 2" | ||
region_configs { | ||
provider_name = "AWS" | ||
region_name = "US_WEST_2" | ||
priority = 7 | ||
electable_specs { | ||
node_count = 3 | ||
instance_size = "M10" | ||
disk_size_gb = 80 | ||
} | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.