feat: add Chronicle NativeDashboard resource#16735
feat: add Chronicle NativeDashboard resource#16735divyamjain000 wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
Conversation
0b78cb2 to
f54a9c4
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: |
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
f54a9c4 to
1a124be
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: |
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: |
Tests analyticsTotal tests: 27 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
1a124be to
f9002f0
Compare
f9002f0 to
d4db073
Compare
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: |
Tests analyticsTotal tests: 27 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: |
Tests analyticsTotal tests: 27 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
| api: 'https://cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances.nativeDashboards' | ||
| base_url: projects/{{project}}/locations/{{location}}/instances/{{instance}}/nativeDashboards | ||
| update_mask: true | ||
| update_verb: PATCH |
There was a problem hiding this comment.
nit; Can we move these two down and keep all the links together for better readability?
| properties: | ||
| - name: charts | ||
| type: Array | ||
| ignore_read: true |
There was a problem hiding this comment.
Is there a specific reason for ignore_read: true on the charts property? I believe the dashboard definition is returned by the API on GET requests. If we ignore it on read, Terraform won't be able to detect drift if charts are modified outside of Terraform (e.g., via the UI). If the API response for this field is consistent, we should remove this to ensure full state management.
| properties: | ||
| - name: chartLayout | ||
| type: NestedObject | ||
| ignore_read: true |
There was a problem hiding this comment.
Similar to the charts array, why is ignore_read: true set for chartLayout? If the layout coordinates are returned by the API, they should be tracked in the state to allow users to manage the dashboard layout via Terraform.
|
|
||
| examples: | ||
| - name: chronicle_nativedashboard_basic | ||
| primary_resource_id: my-basic-dashboard |
There was a problem hiding this comment.
nit; While not a blocker, using underscores consistently (e.g., my_basic_dashboard) aligns better with common Terraform practices.
| custom_flatten: 'templates/terraform/custom_flatten/id_from_name.tmpl' | ||
| description: The unique ID of the Dashboard. | ||
|
|
||
| - name: access |
There was a problem hiding this comment.
For both the access and type fields, consider changing the type from String to Enum and formally listing the enum_values. This allows Terraform to catch typos or invalid values locally before even making an API call, improving the user experience.
There was a problem hiding this comment.
Are these values going to be expanded in the future? We tend to prefer strings is the set of values is mutable, but enums if it's relatively static. For example, if you're planning to add several other values here in the next few years, it tends to be easier for users if they don't have to upgrade provider versions to be able to use them
| min_version: 'beta' | ||
| ignore_read_extra: | ||
| - "last_viewed_time" | ||
| vars: |
There was a problem hiding this comment.
nit: the variables resource_name and dashboard are defined but never referenced in the chronicle_nativedashboard_basic.tf.tmpl file. We should remove these to keep the example clean and focused
| output: true | ||
| description: The full resource name of the dashboard. | ||
|
|
||
| - name: dashboardId |
There was a problem hiding this comment.
Is dashboardId not user-settable? It should be per https://google.aip.dev/133#user-specified-ids
| custom_flatten: 'templates/terraform/custom_flatten/id_from_name.tmpl' | ||
| description: The unique ID of the Dashboard. | ||
|
|
||
| - name: access |
There was a problem hiding this comment.
Are these values going to be expanded in the future? We tend to prefer strings is the set of values is mutable, but enums if it's relatively static. For example, if you're planning to add several other values here in the next few years, it tends to be easier for users if they don't have to upgrade provider versions to be able to use them
|
|
||
| - name: dashboardUserData | ||
| type: NestedObject | ||
| flatten_object: true |
There was a problem hiding this comment.
I don't think flatten object makes sense with an object with child fields
|
|
||
| - name: definition | ||
| type: NestedObject | ||
| flatten_object: true |
There was a problem hiding this comment.
Again, why flatten object
This PR introduces Terraform support for the Chronicle Native Dashboard resource by adding the
google_chronicle_native_dashboardresource.This includes:
Related Issue
Fixes hashicorp/terraform-provider-google#26483
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.