-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Convert clusters with 1 replication_spec and multiple region_configs #18
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e447591
failing test
lantoli c71389f
multiple region configs
lantoli cbed75f
passing test with fixed order
lantoli cbd7539
fix token types
lantoli 8df865f
make priority mandatory
lantoli 6a161a4
extract setPriority
lantoli 2a17f90
getRegionConfigs
lantoli 2548b9a
order configs by descending priority
lantoli 9043ca1
dynamic blocks not supported
lantoli 47e1981
read only analytics min
lantoli 23daf4a
read only and analytics all params
lantoli 78f4d6a
move to var block
lantoli 76684e7
go 1.23.6
lantoli 1563d36
typo
lantoli 8434868
countVal refactor
lantoli b21b3b2
have all getSpecs together
lantoli 70597f5
linter
lantoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
internal/convert/testdata/clu2adv/analytics_read_only_all_params.in.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "mongodbatlas_cluster" "ar" { | ||
project_id = var.project_id | ||
name = "ar" | ||
cluster_type = "REPLICASET" | ||
provider_name = "AWS" | ||
provider_instance_size_name = "M10" | ||
disk_size_gb = 90 | ||
provider_volume_type = "PROVISIONED" | ||
provider_disk_iops = 100 | ||
replication_specs { | ||
num_shards = 1 | ||
regions_config { | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_nodes = 3 | ||
analytics_nodes = 2 | ||
read_only_nodes = 1 | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
internal/convert/testdata/clu2adv/analytics_read_only_all_params.out.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
resource "mongodbatlas_advanced_cluster" "ar" { | ||
project_id = var.project_id | ||
name = "ar" | ||
cluster_type = "REPLICASET" | ||
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 = 90 | ||
ebs_volume_type = "PROVISIONED" | ||
disk_iops = 100 | ||
} | ||
read_only_specs = { | ||
node_count = 1 | ||
instance_size = "M10" | ||
disk_size_gb = 90 | ||
ebs_volume_type = "PROVISIONED" | ||
disk_iops = 100 | ||
} | ||
analytics_specs = { | ||
node_count = 2 | ||
instance_size = "M10" | ||
disk_size_gb = 90 | ||
ebs_volume_type = "PROVISIONED" | ||
disk_iops = 100 | ||
} | ||
}] | ||
}] | ||
|
||
# Generated by atlas-cli-plugin-terraform. | ||
# Please confirm that all references to this resource are updated. | ||
} |
17 changes: 17 additions & 0 deletions
17
internal/convert/testdata/clu2adv/analytics_read_only_min_params.in.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resource "mongodbatlas_cluster" "ar" { | ||
project_id = var.project_id | ||
name = "ar" | ||
cluster_type = "REPLICASET" | ||
provider_name = "AWS" | ||
provider_instance_size_name = "M10" | ||
replication_specs { | ||
num_shards = 1 | ||
regions_config { | ||
region_name = "US_EAST_1" | ||
priority = 7 | ||
electable_nodes = 3 | ||
analytics_nodes = 2 | ||
read_only_nodes = 1 | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.