From bf3b6a52be924270dcb3a32530188a8b94ac851d Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 25 Sep 2019 10:07:54 +0200 Subject: [PATCH] Fix parsing compute.interval for apm and log queries in dashboards --- datadog/resource_datadog_dashboard.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datadog/resource_datadog_dashboard.go b/datadog/resource_datadog_dashboard.go index 3d0a71eb4..dbb396bff 100644 --- a/datadog/resource_datadog_dashboard.go +++ b/datadog/resource_datadog_dashboard.go @@ -3853,8 +3853,10 @@ func buildDatadogApmOrLogQuery(terraformQuery map[string]interface{}) *datadog.W if facet, ok := terraformCompute["facet"].(string); ok && len(facet) != 0 { datadogCompute.Facet = datadog.String(facet) } - if v, err := strconv.ParseInt(terraformCompute["interval"].(string), 10, 64); err == nil { - datadogCompute.Interval = datadog.Int(int(v)) + if interval, ok := terraformCompute["interval"].(string); ok { + if v, err := strconv.ParseInt(interval, 10, 64); err == nil { + datadogCompute.Interval = datadog.Int(int(v)) + } } datadogQuery.Compute = &datadogCompute // Search