-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat: Adds mongodbatlas_project_ip_addresses
data source
#2533
Conversation
Good work, some things to take into account:
|
Config: ProjectIPAddressesConfig(projectID), | ||
Check: resource.ComposeAggregateTestCheckFunc( | ||
resource.TestCheckResourceAttrSet(dataSourceName, "project_id"), | ||
resource.TestCheckResourceAttr(dataSourceName, "services.clusters.#", "0"), |
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.
could we have a test where a cluster is created in the project and it has some inbound and outbound ip addresses?
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.
have my doubts if we want to include a cluster creation/deletion for this, considering we do have a unit test that verifies correct handling of a complete response with ip addresses. No strong opinion, looping in @lantoli @maastha @EspenAlbert @marcosuma in case there is additional inputs.
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.
some additional points to consider
mongodbatlas_project_ip_addresses
data source
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.
LGTM
@@ -0,0 +1,3 @@ | |||
```release-note:new-datasource | |||
data-source/mongodbatlas_project_ip_addresses |
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.
@AgustinBettati knit: this seems like a singular ds, i see API endpoint is in plural, but wonder if we should call this ds mongodbatlas_project_ip_address.
as an example this ds doesn't seem to have the normal attributes of a plural ds such as results
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.
Good call out.
Definitely not our regular case of plural data source with results. I was taking inspiration from mongodbatlas_control_plane_ip_addresses that is similar in the sense that is it an isolated data source associated to single get endpoint, and API is not using regular pagination to return all results. As both of them return multiple ip addresses thought this name would be more appropriate.
Description
In this PR I implement the new mongodbatlas_project_ip_addresses Data Source. This PR includes the implementation, testing and documentation. As a follow-up, there will also be a deprecation for the ip_addresses attribute in the project resource and data source.
Link to any related issue(s): CLOUDP-262915
Agustin Edit:
Using the following configuration
Verified all possible scenarios:
Type of change:
Required Checklist:
Further comments