Skip to content

feat: add Chronicle NativeDashboard resource#16735

Open
divyamjain000 wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
divyamjain000:chronicle-nativedashboard-divyamjain
Open

feat: add Chronicle NativeDashboard resource#16735
divyamjain000 wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
divyamjain000:chronicle-nativedashboard-divyamjain

Conversation

@divyamjain000
Copy link

@divyamjain000 divyamjain000 commented Mar 17, 2026

This PR introduces Terraform support for the Chronicle Native Dashboard resource by adding the google_chronicle_native_dashboard resource.

This includes:

  • Schema definition for the resource.
  • Create and Update functionalities.
  • Acceptance tests to cover the resource lifecycle.

Related Issue
Fixes hashicorp/terraform-provider-google#26483

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

`google_chronicle_native_dashboard`

@divyamjain000 divyamjain000 force-pushed the chronicle-nativedashboard-divyamjain branch from 0b78cb2 to f54a9c4 Compare March 17, 2026 06:11
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 6 files changed, 1985 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 1985 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 483 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_native_dashboard (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_native_dashboard" "primary" {
  charts {
    chart_layout {
      span_x  = # value needed
      span_y  = # value needed
      start_x = # value needed
      start_y = # value needed
    }
    dashboard_chart = # value needed
    filters_ids     = # value needed
  }
  dashboard_id = # value needed
  filters {
    chart_ids    = # value needed
    is_mandatory = # value needed
  }
}


@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 27
Passed tests: 24
Skipped tests: 1
Affected tests: 2

Click here to see the affected service packages
  • chronicle

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccChronicleNativeDashboard_chronicleNativedashboardBasicExample
  • TestAccChronicleNativeDashboard_chronicleNativedashboardUpdateExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccChronicleNativeDashboard_chronicleNativedashboardBasicExample [Debug log]
TestAccChronicleNativeDashboard_chronicleNativedashboardUpdateExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@divyamjain000 divyamjain000 force-pushed the chronicle-nativedashboard-divyamjain branch from f54a9c4 to 1a124be Compare March 17, 2026 06:19
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 406 insertions(+))
google-beta provider: Diff ( 6 files changed, 1977 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 483 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_native_dashboard (1 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_native_dashboard" "primary" {
  charts {
    chart_layout {
      span_x  = # value needed
      span_y  = # value needed
      start_x = # value needed
      start_y = # value needed
    }
    dashboard_chart = # value needed
    filters_ids     = # value needed
  }
  dashboard_id = # value needed
  filters {
    chart_ids    = # value needed
    field_path   = # value needed
    is_mandatory = # value needed
  }
  is_pinned = # value needed
}


@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 27
Passed tests: 25
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • chronicle

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccChronicleNativeDashboard_chronicleNativedashboardBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccChronicleNativeDashboard_chronicleNativedashboardBasicExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 302 insertions(+))
google-beta provider: Diff ( 6 files changed, 1987 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 483 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_native_dashboard (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_native_dashboard" "primary" {
  charts {
    chart_layout {
      span_x  = # value needed
      span_y  = # value needed
      start_x = # value needed
      start_y = # value needed
    }
    dashboard_chart = # value needed
    filters_ids     = # value needed
  }
  dashboard_id = # value needed
  filters {
    chart_ids    = # value needed
    is_mandatory = # value needed
  }
}


@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 27
Passed tests: 25
Skipped tests: 1
Affected tests: 1

Click here to see the affected service packages
  • chronicle

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccChronicleNativeDashboard_chronicleNativedashboardBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccChronicleNativeDashboard_chronicleNativedashboardBasicExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@divyamjain000 divyamjain000 force-pushed the chronicle-nativedashboard-divyamjain branch from 1a124be to f9002f0 Compare March 17, 2026 06:53
@divyamjain000 divyamjain000 force-pushed the chronicle-nativedashboard-divyamjain branch from f9002f0 to d4db073 Compare March 17, 2026 06:54
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 303 insertions(+))
google-beta provider: Diff ( 6 files changed, 1989 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 483 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_native_dashboard (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_native_dashboard" "primary" {
  charts {
    chart_layout {
      span_x  = # value needed
      span_y  = # value needed
      start_x = # value needed
      start_y = # value needed
    }
    dashboard_chart = # value needed
    filters_ids     = # value needed
  }
  dashboard_id = # value needed
  filters {
    chart_ids    = # value needed
    is_mandatory = # value needed
  }
}


@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 27
Passed tests: 26
Skipped tests: 1
Affected tests: 0

Click here to see the affected service packages
  • chronicle

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 303 insertions(+))
google-beta provider: Diff ( 6 files changed, 1989 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 483 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_chronicle_native_dashboard (3 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_chronicle_native_dashboard" "primary" {
  charts {
    chart_layout {
      span_x  = # value needed
      span_y  = # value needed
      start_x = # value needed
      start_y = # value needed
    }
    dashboard_chart = # value needed
    filters_ids     = # value needed
  }
  dashboard_id = # value needed
  filters {
    chart_ids    = # value needed
    is_mandatory = # value needed
  }
}


@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 27
Passed tests: 26
Skipped tests: 1
Affected tests: 0

Click here to see the affected service packages
  • chronicle

🟢 All tests passed!

View the build log

@divyamjain000 divyamjain000 marked this pull request as ready for review March 17, 2026 07:20
@github-actions github-actions bot requested a review from slevenick March 17, 2026 07:20
@github-actions
Copy link

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
Copy link
Contributor

@ankitgoyal0301 ankitgoyal0301 Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit; Can we move these two down and keep all the links together for better readability?

properties:
- name: charts
type: Array
ignore_read: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think flatten object makes sense with an object with child fields


- name: definition
type: NestedObject
flatten_object: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, why flatten object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Terraform support for Chronicle Native Dashboard resource

4 participants