From 8b74a15d5d09303bb211c0f697c295e0f2a6e767 Mon Sep 17 00:00:00 2001 From: vagrawal-newrelic Date: Wed, 11 Dec 2024 14:20:30 +0530 Subject: [PATCH] fix(dashboard): add multi account support for nrql query in dashboard --- internal/utils/terraform/dashboard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/utils/terraform/dashboard.go b/internal/utils/terraform/dashboard.go index eae5a6a84..e40e49829 100644 --- a/internal/utils/terraform/dashboard.go +++ b/internal/utils/terraform/dashboard.go @@ -63,7 +63,7 @@ type DashboardWidgetFacet struct { } type DashboardWidgetNRQLQuery struct { - AccountID int `json:"accountId"` + AccountID []int `json:"accountIds"` Query string `json:"query"` } @@ -170,7 +170,7 @@ func GenerateDashboardHCL(resourceLabel string, shiftWidth int, input []byte) (s for _, q := range config.NRQLQueries { h.WriteBlock("nrql_query", []string{}, func() { - h.WriteIntAttributeIfNotZero("account_id", q.AccountID) + h.WriteIntArrayAttribute("account_ids", q.AccountID) h.WriteMultilineStringAttribute("query", q.Query) }) }