From 683e727a18c1e61c60b94471548dd892a1d83f06 Mon Sep 17 00:00:00 2001 From: James Goodhouse Date: Wed, 16 Oct 2019 20:56:15 -0700 Subject: [PATCH 1/6] Update resource_newrelic_nrql_alert_condition.go --- newrelic/resource_newrelic_nrql_alert_condition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newrelic/resource_newrelic_nrql_alert_condition.go b/newrelic/resource_newrelic_nrql_alert_condition.go index d9a939e2c..0c4fddd24 100644 --- a/newrelic/resource_newrelic_nrql_alert_condition.go +++ b/newrelic/resource_newrelic_nrql_alert_condition.go @@ -75,7 +75,7 @@ func resourceNewRelicNrqlAlertCondition() *schema.Resource { "duration": { Type: schema.TypeInt, Required: true, - ValidateFunc: intInSlice([]int{1, 2, 3, 4, 5, 10, 15, 30, 60, 120}), + ValidateFunc: validation.IntBetween(2, 120), }, "operator": { Type: schema.TypeString, From 9b88b1126475b69fadfa245bc7a45fd330a3fb7b Mon Sep 17 00:00:00 2001 From: James Goodhouse Date: Wed, 16 Oct 2019 21:01:33 -0700 Subject: [PATCH 2/6] update docs for change of duration requirements --- website/docs/r/nrql_alert_condition.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/nrql_alert_condition.html.markdown b/website/docs/r/nrql_alert_condition.html.markdown index a36b512b0..3de46aaf0 100644 --- a/website/docs/r/nrql_alert_condition.html.markdown +++ b/website/docs/r/nrql_alert_condition.html.markdown @@ -55,7 +55,7 @@ The following arguments are supported: The `term` mapping supports the following arguments: - * `duration` - (Required) In minutes, must be: `1`, `2`, `3`, `4`, `5`, `10`, `15`, `30`, `60`, or `120`. + * `duration` - (Required) In minutes, must be in the range of `2` to `120`, inclusive. * `operator` - (Optional) `above`, `below`, or `equal`. Defaults to `equal`. * `priority` - (Optional) `critical` or `warning`. Defaults to `critical`. * `threshold` - (Required) Must be 0 or greater. From a9a752ef2ad089b0e2159caf12b881865579a3a9 Mon Sep 17 00:00:00 2001 From: James Goodhouse Date: Wed, 16 Oct 2019 21:03:24 -0700 Subject: [PATCH 3/6] update import for nrql alert condition --- website/docs/r/nrql_alert_condition.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/nrql_alert_condition.html.markdown b/website/docs/r/nrql_alert_condition.html.markdown index 3de46aaf0..557e12253 100644 --- a/website/docs/r/nrql_alert_condition.html.markdown +++ b/website/docs/r/nrql_alert_condition.html.markdown @@ -76,8 +76,8 @@ The following attributes are exported: ## Import -Alert conditions can be imported using the `id`, e.g. +Alert conditions can be imported using the a composite ID of `: `id`, e.g. ``` -$ terraform import newrelic_nrql_alert_condition.main 12345 +$ terraform import newrelic_nrql_alert_condition.main 12345:67890 ``` From ba737f2f8db4ac5275e7681b61abbc55f01be329 Mon Sep 17 00:00:00 2001 From: James Goodhouse Date: Thu, 17 Oct 2019 14:30:28 -0700 Subject: [PATCH 4/6] fix value --- newrelic/resource_newrelic_nrql_alert_condition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newrelic/resource_newrelic_nrql_alert_condition.go b/newrelic/resource_newrelic_nrql_alert_condition.go index 0c4fddd24..d469d5109 100644 --- a/newrelic/resource_newrelic_nrql_alert_condition.go +++ b/newrelic/resource_newrelic_nrql_alert_condition.go @@ -75,7 +75,7 @@ func resourceNewRelicNrqlAlertCondition() *schema.Resource { "duration": { Type: schema.TypeInt, Required: true, - ValidateFunc: validation.IntBetween(2, 120), + ValidateFunc: validation.IntBetween(1, 120), }, "operator": { Type: schema.TypeString, From 85e7ac6f76d7821fc2f2d030d28435e9aaecf266 Mon Sep 17 00:00:00 2001 From: James Goodhouse Date: Thu, 17 Oct 2019 14:31:14 -0700 Subject: [PATCH 5/6] fix typo --- website/docs/r/nrql_alert_condition.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/nrql_alert_condition.html.markdown b/website/docs/r/nrql_alert_condition.html.markdown index 557e12253..df674e228 100644 --- a/website/docs/r/nrql_alert_condition.html.markdown +++ b/website/docs/r/nrql_alert_condition.html.markdown @@ -76,7 +76,7 @@ The following attributes are exported: ## Import -Alert conditions can be imported using the a composite ID of `: `id`, e.g. +Alert conditions can be imported using a composite ID of `: `id`, e.g. ``` $ terraform import newrelic_nrql_alert_condition.main 12345:67890 From 634878108e20f5fc63f727616d884403dacd34f4 Mon Sep 17 00:00:00 2001 From: James Goodhouse Date: Thu, 17 Oct 2019 14:31:33 -0700 Subject: [PATCH 6/6] fix allowed value --- website/docs/r/nrql_alert_condition.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/nrql_alert_condition.html.markdown b/website/docs/r/nrql_alert_condition.html.markdown index df674e228..ded04a465 100644 --- a/website/docs/r/nrql_alert_condition.html.markdown +++ b/website/docs/r/nrql_alert_condition.html.markdown @@ -55,7 +55,7 @@ The following arguments are supported: The `term` mapping supports the following arguments: - * `duration` - (Required) In minutes, must be in the range of `2` to `120`, inclusive. + * `duration` - (Required) In minutes, must be in the range of `1` to `120`, inclusive. * `operator` - (Optional) `above`, `below`, or `equal`. Defaults to `equal`. * `priority` - (Optional) `critical` or `warning`. Defaults to `critical`. * `threshold` - (Required) Must be 0 or greater.