-
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR converts Terraform configuration blocks from replication_specs
and region_configs
blocks to array syntax for MongoDB Atlas advanced clusters. The conversion transforms block-style syntax to list-style syntax and adds validation to ensure required structures are present.
Key changes:
- Converts nested
replication_specs
blocks to array format - Converts nested
region_configs
blocks to array format - Adds validation for missing replication specs and region configs
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
internal/convert/adv2v2.go | Core conversion logic with validation for required specs and configs |
internal/convert/testdata/adv2v2/*.in.tf | Input test files showing original block syntax |
internal/convert/testdata/adv2v2/*.out.tf | Expected output files showing converted array syntax |
internal/convert/testdata/adv2v2/errors.json | Error message definitions for validation failures |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
@@ -0,0 +1,6 @@ | |||
resource "mongodbatlas_advanced_cluster" "no_replication_specs" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in all the examples I noticed we don't use num_shards
: am I right? I am guessing that's on purpose because you don't still support it but you will?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question applies to the .in.tf
examples where there's usage of deprecated fields, such as root disk_size_gb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Love that is so little actual logic change! 👏
Description
Convert multi replication specs multi regions advanced clusters
Link to any related issue(s): CLOUDP-339184
Type of change:
Required Checklist:
Further comments