diff --git a/.go-version b/.go-version index 783fda8..5c87d60 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.98.0 +1.98.1 diff --git a/docs/resources/alert.md b/docs/resources/alert.md index 3f25020..26f12c4 100644 --- a/docs/resources/alert.md +++ b/docs/resources/alert.md @@ -209,8 +209,8 @@ Optional: - `comparison_window_ms` (Number) - `display_type` (String) - `is_donut` (Boolean) -- `max` (Number) -- `min` (Number) +- `max` (String) +- `min` (String) - `sort_by` (String) - `sort_direction` (String) - `y_axis_log_base` (Number) @@ -280,8 +280,8 @@ Optional: - `comparison_window_ms` (Number) - `display_type` (String) - `is_donut` (Boolean) -- `max` (Number) -- `min` (Number) +- `max` (String) +- `min` (String) - `sort_by` (String) - `sort_direction` (String) - `y_axis_log_base` (Number) diff --git a/docs/resources/dashboard.md b/docs/resources/dashboard.md index 3ce082c..d543076 100644 --- a/docs/resources/dashboard.md +++ b/docs/resources/dashboard.md @@ -137,8 +137,8 @@ Optional: - `comparison_window_ms` (Number) - `display_type` (String) - `is_donut` (Boolean) -- `max` (Number) -- `min` (Number) +- `max` (String) +- `min` (String) - `sort_by` (String) - `sort_direction` (String) - `y_axis_log_base` (Number) @@ -316,8 +316,8 @@ Optional: - `comparison_window_ms` (Number) - `display_type` (String) - `is_donut` (Boolean) -- `max` (Number) -- `min` (Number) +- `max` (String) +- `min` (String) - `sort_by` (String) - `sort_direction` (String) - `y_axis_log_base` (Number) diff --git a/lightstep/resource_dashboard.go b/lightstep/resource_dashboard.go index c16cc83..3c0742f 100644 --- a/lightstep/resource_dashboard.go +++ b/lightstep/resource_dashboard.go @@ -2,6 +2,7 @@ package lightstep import ( "fmt" + "regexp" "github.com/lightstep/terraform-provider-lightstep/client" @@ -118,12 +119,14 @@ func getUnifiedQuerySchemaMap() map[string]*schema.Schema { Optional: true, }, "min": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^(\d|\.)*$`), ""), }, "max": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^(\d|\.)*$`), ""), }, }, }, diff --git a/lightstep/resource_dashboard_test.go b/lightstep/resource_dashboard_test.go index b2b403e..18dbf72 100644 --- a/lightstep/resource_dashboard_test.go +++ b/lightstep/resource_dashboard_test.go @@ -1529,7 +1529,7 @@ group { query_string = "metric cpu.utilization | delta | group_by[], sum" display_type_options { min = 0 - max = 100 + max = "" } } } @@ -1551,7 +1551,7 @@ group { resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.#", "1"), resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display", "gauge"), resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.min", "0"), - resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.max", "100"), + resource.TestCheckResourceAttr(resourceName, "group.0.chart.0.query.0.display_type_options.0.max", ""), ), }, },