diff --git a/go.mod b/go.mod index 95d8a0335..066cc2d59 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/newrelic/terraform-provider-newrelic/v2 go 1.22 +replace github.com/newrelic/newrelic-client-go/v2 => github.com/newrelic/newrelic-client-go/v2 v2.51.4-0.20241217072802-15dfd8382ed7 + toolchain go1.22.6 require ( diff --git a/go.sum b/go.sum index e5471e668..c984003c0 100644 --- a/go.sum +++ b/go.sum @@ -270,8 +270,8 @@ github.com/newrelic/go-agent/v3 v3.30.0 h1:ZXHCT/Cot4iIPwcegCZURuRQOsfmGA6wilW+S github.com/newrelic/go-agent/v3 v3.30.0/go.mod h1:9utrgxlSryNqRrTvII2XBL+0lpofXbqXApvVWPpbzUg= github.com/newrelic/go-insights v1.0.3 h1:zSNp1CEZnXktzSIEsbHJk8v6ZihdPFP2WsO/fzau3OQ= github.com/newrelic/go-insights v1.0.3/go.mod h1:A20BoT8TNkqPGX2nS/Z2fYmKl3Cqa3iKZd4whzedCY4= -github.com/newrelic/newrelic-client-go/v2 v2.51.3 h1:Bu/cUs6nfMjQMPBcxxHt4Xm30tKDT7ttYy/XRDsWP6Y= -github.com/newrelic/newrelic-client-go/v2 v2.51.3/go.mod h1:+RRjI3nDGWT3kLm9Oi3QxpBm70uu8q1upEHBVWCZFpo= +github.com/newrelic/newrelic-client-go/v2 v2.51.4-0.20241217072802-15dfd8382ed7 h1:NQDera2yb7jq/Lz1cl99TGUXKSfg1UrRKH1Y5p1ac/s= +github.com/newrelic/newrelic-client-go/v2 v2.51.4-0.20241217072802-15dfd8382ed7/go.mod h1:+RRjI3nDGWT3kLm9Oi3QxpBm70uu8q1upEHBVWCZFpo= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= diff --git a/newrelic/resource_newrelic_one_dashboard.go b/newrelic/resource_newrelic_one_dashboard.go index a78248e31..a91374ca0 100644 --- a/newrelic/resource_newrelic_one_dashboard.go +++ b/newrelic/resource_newrelic_one_dashboard.go @@ -518,11 +518,12 @@ func dashboardWidgetDataFormatSchemaElem() *schema.Resource { func dashboardWidgetNRQLQuerySchemaElem() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ - "account_id": { - Type: schema.TypeInt, + "account_ids": { + Type: schema.TypeList, Optional: true, Computed: true, Description: "The account id used for the NRQL query.", + Elem: &schema.Schema{Type: schema.TypeInt}, }, "query": { Type: schema.TypeString, diff --git a/newrelic/resource_newrelic_one_dashboard_test.go b/newrelic/resource_newrelic_one_dashboard_test.go index 4b3a16789..3a6cacff5 100644 --- a/newrelic/resource_newrelic_one_dashboard_test.go +++ b/newrelic/resource_newrelic_one_dashboard_test.go @@ -621,7 +621,7 @@ func testAccCheckNewRelicOneDashboardConfig_FilterCurrentDashboard(dashboardName column = 1 nrql_query { - account_id = ` + accountID + ` + account_ids = [` + accountID + `] query = "FROM Transaction SELECT average(duration) FACET appName" } @@ -651,7 +651,7 @@ func testAccCheckNewRelicOneDashboardConfig_PageFull(pageName string, accountID refresh_rate = 30000 nrql_query { - account_id = ` + accountID + ` + account_ids = [` + accountID + `] query = "FROM Transaction SELECT 51 TIMESERIES" } } @@ -724,7 +724,7 @@ func testAccCheckNewRelicOneDashboardConfig_PageFull(pageName string, accountID row = 10 column = 1 nrql_query { - account_id = ` + accountID + ` + account_ids = [` + accountID + `] query = "FROM Transaction SELECT 1 TIMESERIES" } nrql_query { @@ -913,7 +913,7 @@ func testAccCheckNewRelicOneDashboardConfig_PageFullChanged(pageName string, acc width = 12 nrql_query { - account_id = ` + accountID + ` + account_ids = [` + accountID + `] query = "FROM Transaction SELECT 51 TIMESERIES LIMIT 10" } } @@ -983,7 +983,7 @@ func testAccCheckNewRelicOneDashboardConfig_PageFullChanged(pageName string, acc row = 10 column = 1 nrql_query { - account_id = ` + accountID + ` + account_ids = [` + accountID + `] query = "FROM Transaction SELECT 1 TIMESERIES LIMIT 10" } nrql_query { @@ -1347,7 +1347,7 @@ func testAccCheckNewRelicOneDashboardConfig_RawConfig(dashboardName string, acco width = 4 nrql_query { - account_id = ` + accountID + ` + account_ids = [` + accountID + `] query = <