-
Notifications
You must be signed in to change notification settings - Fork 190
feat: Adds new mongodbatlas_control_plane_ip_addresses
data source
#2331
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
outboundGcpTfMap, outGcpDiags := toTFMap(ctx, outbound.GetGcp()) | ||
outboundAzureTfMap, outAzureDiags := toTFMap(ctx, outbound.GetAzure()) | ||
|
||
allDiags := slices.Concat(inAwsDiags, inGcpDiags, inAzureDiags, outAwsDiags, outGcpDiags, outAzureDiags) |
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.
Go 1.22 :)
APIx bot: a message has been sent to Docs Slack channel |
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! LGTM
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.
Great job!
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
nit: could this PR have been split into smaller ones?
Great job @AgustinBettati - did you use the automation to create the scaffolding? Also +1 to @maastha sentiment, curious if we can come up with a smaller PR approach next time: biggest challenge is to make sure we don't miss smaller bugs such as misspells |
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 LGTM % a few minor tweaks
|
||
### Read-Only | ||
|
||
- `inbound` (Attributes) List of inbound IP addresses to the Atlas control plane, categorized by cloud provider. If your application allows outbound HTTP requests only to specific IP addresses, you must allow access to the following IP addresses so that your API requests can reach the Atlas control plane. (see [below for nested schema](#nestedatt--inbound)) |
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.
added period at end + removed parenthetical as the last phrase is a complete sentence.
- `inbound` (Attributes) List of inbound IP addresses to the Atlas control plane, categorized by cloud provider. If your application allows outbound HTTP requests only to specific IP addresses, you must allow access to the following IP addresses so that your API requests can reach the Atlas control plane. (see [below for nested schema](#nestedatt--inbound)) | |
- `inbound` (Attributes) List of inbound IP addresses to the Atlas control plane, categorized by cloud provider. If your application allows outbound HTTP requests only to specific IP addresses, you must allow access to the following IP addresses so that your API requests can reach the Atlas control plane. See [below for nested schema](#nestedatt--inbound). |
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.
Unfortunately this part of the text is autogenerated by an external tool. Can look into raising an issue if this is a concern.
- `azure` (Map of List of String) Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. | ||
- `gcp` (Map of List of String) Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. | ||
|
||
For more information see: [MongoDB Atlas API - Return All Control Plane IP Addresses](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIPAddresses) Documentation. |
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.
For more information see: [MongoDB Atlas API - Return All Control Plane IP Addresses](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIPAddresses) Documentation. | |
For more information see: [MongoDB Atlas API - Return All Control Plane IP Addresses](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIPAddresses) in the Atlas Administration API documentation. |
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.
given that it is already mentioning MongoDB Atlas API
I believe this additional text could be redundant. WDYT?
}, | ||
Computed: true, | ||
Description: "Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region.", | ||
MarkdownDescription: "Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region.", |
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.
not in this PR but at some moment we might want to create a utility function that for instance, you only define Description, and it goes through the schema recursively filling MarkdownDescription
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.
Yes that could be a possibility. Would take into account that these descriptions are created by the scaffolding tool (coming from the api spec), so not much effort from our side when they are being defined.
@@ -187,6 +187,7 @@ jobs: | |||
search_index: ${{ steps.filter.outputs.search_index == 'true' || env.mustTrigger == 'true' }} | |||
serverless: ${{ steps.filter.outputs.serverless == 'true' || env.mustTrigger == 'true' }} | |||
stream: ${{ steps.filter.outputs.stream == 'true' || env.mustTrigger == 'true' }} | |||
control_plane_ip_addresses: ${{ steps.filter.outputs.control_plane_ip_addresses == 'true' || env.mustTrigger == 'true' }} |
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.
are we also creating the resource for CFN and CDK?
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.
Given that it is only a get request (and therefor a single data source in tf) I believe this could not be added as a resource in CFN.
@marcosuma yes for this case used initial file scaffolding, schema and model scaffolding, and then documentation autogeneration. Included some fixes to these tools along the way, related to our new file naming convention aligned with our latest resource push-based log export.
@maastha yes I see how this got a little to big as many small changes were included. Would keep fixes related to scaffolding + setup in CI as separate PR to avoid additional noise to the actual production code. Thanks for the input and sorry if the review was a challenge here. |
no problem! Also, just FYI we do have a possible approach to split new feature PRs captured in our TF best practices doc, happy to discuss any alternatives/your general inputs there:) |
Description
Link to any related issue(s): CLOUDP-250897
Defines a new data source for the following endpoint: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIPAddresses
Example API response and resulting tf state
Resulting terraform state:
Type of change:
Required Checklist:
Further comments