diff --git a/docs/data-sources/monitor_v2.md b/docs/data-sources/monitor_v2.md
index 405d8be5..9b6f8054 100644
--- a/docs/data-sources/monitor_v2.md
+++ b/docs/data-sources/monitor_v2.md
@@ -385,18 +385,8 @@ Read-Only:
Read-Only:
-- `interval` (Block List) Should be used to run explicit ad-hoc queries. (see [below for nested schema](#nestedblock--scheduling--interval))
- `transform` (Block List) Should be used to defer scheduling to the transformer and evaluate when data becomes available. (see [below for nested schema](#nestedblock--scheduling--transform))
-
-### Nested Schema for `scheduling.interval`
-
-Read-Only:
-
-- `interval` (String) How often the monitor should attempt to run.
-- `randomize` (String) A maximum +/- to apply to the interval to avoid things like harmonics and work stacking up in parallel.
-
-
### Nested Schema for `scheduling.transform`
diff --git a/docs/resources/monitor_v2.md b/docs/resources/monitor_v2.md
index b3b9bf73..4ace5d3d 100644
--- a/docs/resources/monitor_v2.md
+++ b/docs/resources/monitor_v2.md
@@ -464,18 +464,8 @@ Optional:
Optional:
-- `interval` (Block List, Max: 1) Should be used to run explicit ad-hoc queries. (see [below for nested schema](#nestedblock--scheduling--interval))
- `transform` (Block List, Max: 1) Should be used to defer scheduling to the transformer and evaluate when data becomes available. (see [below for nested schema](#nestedblock--scheduling--transform))
-
-### Nested Schema for `scheduling.interval`
-
-Required:
-
-- `interval` (String) How often the monitor should attempt to run.
-- `randomize` (String) A maximum +/- to apply to the interval to avoid things like harmonics and work stacking up in parallel.
-
-
### Nested Schema for `scheduling.transform`
diff --git a/observe/data_source_monitor_v2.go b/observe/data_source_monitor_v2.go
index a9a4df9a..b02283ec 100644
--- a/observe/data_source_monitor_v2.go
+++ b/observe/data_source_monitor_v2.go
@@ -205,26 +205,6 @@ func dataSourceMonitorV2() *schema.Resource {
Description: descriptions.Get("monitorv2", "schema", "scheduling", "description"),
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
- "interval": { // MonitorV2IntervalScheduleInput
- Type: schema.TypeList,
- Optional: true,
- Computed: true,
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "interval", "description"),
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "interval": { // Duration!
- Type: schema.TypeString,
- Computed: true,
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "interval", "interval"),
- },
- "randomize": { // Duration!
- Type: schema.TypeString,
- Computed: true,
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "interval", "randomize"),
- },
- },
- },
- },
"transform": { // MonitorV2TransformScheduleInput
Type: schema.TypeList,
Optional: true,
diff --git a/observe/data_source_monitor_v2_test.go b/observe/data_source_monitor_v2_test.go
index 19c11b98..7abe49e8 100644
--- a/observe/data_source_monitor_v2_test.go
+++ b/observe/data_source_monitor_v2_test.go
@@ -9,7 +9,6 @@ import (
)
func TestAccObserveGetIDMonitorV2CountData(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -47,9 +46,8 @@ func TestAccObserveGetIDMonitorV2CountData(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
}
@@ -66,8 +64,7 @@ func TestAccObserveGetIDMonitorV2CountData(t *testing.T) {
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.level", "informational"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.count.0.compare_values.0.compare_fn", "greater"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.count.0.compare_values.0.value_int64.0", "0"),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.interval.0.interval", "15m0s"),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.interval.0.randomize", "0s"),
+ resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.transform.0.freshness_goal", "15m0s"),
),
},
},
@@ -75,7 +72,6 @@ func TestAccObserveGetIDMonitorV2CountData(t *testing.T) {
}
func TestAccObserveGetIDMonitorV2Threshold(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -107,9 +103,8 @@ func TestAccObserveGetIDMonitorV2Threshold(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
}
@@ -128,8 +123,7 @@ func TestAccObserveGetIDMonitorV2Threshold(t *testing.T) {
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.threshold.0.compare_values.0.value_int64.0", "0"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.threshold.0.value_column_name", "temp_number"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.threshold.0.aggregation", "all_of"),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.interval.0.interval", "15m0s"),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.interval.0.randomize", "0s"),
+ resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.transform.0.freshness_goal", "15m0s"),
),
},
},
@@ -137,7 +131,6 @@ func TestAccObserveGetIDMonitorV2Threshold(t *testing.T) {
}
func TestAccObserveGetIDMonitorV2Promote(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -150,7 +143,7 @@ func TestAccObserveGetIDMonitorV2Promote(t *testing.T) {
workspace = data.observe_workspace.default.oid
rule_kind = "promote"
name = "%[1]s"
- lookback_time = "10s"
+ lookback_time = "0s"
inputs = {
"test" = observe_datastream.test.dataset
}
@@ -174,9 +167,8 @@ func TestAccObserveGetIDMonitorV2Promote(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
}
@@ -188,14 +180,13 @@ func TestAccObserveGetIDMonitorV2Promote(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.observe_monitor_v2.lookup", "workspace"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "name", randomPrefix),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "lookback_time", "10s"),
+ resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "lookback_time", "0s"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rule_kind", "promote"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.level", "informational"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.promote.0.compare_columns.0.compare_values.0.compare_fn", "greater"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.promote.0.compare_columns.0.compare_values.0.value_int64.0", "1"),
resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "rules.0.promote.0.compare_columns.0.column.0.column_path.0.name", "temp_number"),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.interval.0.interval", "15m0s"),
- resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.interval.0.randomize", "0s"),
+ resource.TestCheckResourceAttr("data.observe_monitor_v2.lookup", "scheduling.0.transform.0.freshness_goal", "15m0s"),
),
},
},
diff --git a/observe/resource_monitor_v2.go b/observe/resource_monitor_v2.go
index d7693f8d..f0cd3e92 100644
--- a/observe/resource_monitor_v2.go
+++ b/observe/resource_monitor_v2.go
@@ -216,37 +216,11 @@ func resourceMonitorV2() *schema.Resource {
Description: descriptions.Get("monitorv2", "schema", "scheduling", "description"),
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
- "interval": { // MonitorV2IntervalScheduleInput
- Type: schema.TypeList,
- Optional: true,
- MaxItems: 1,
- ExactlyOneOf: []string{"scheduling.0.interval", "scheduling.0.transform"},
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "interval", "description"),
- Elem: &schema.Resource{
- Schema: map[string]*schema.Schema{
- "interval": { // Duration!
- Type: schema.TypeString,
- Required: true,
- ValidateDiagFunc: validateTimeDuration,
- DiffSuppressFunc: diffSuppressTimeDurationZeroDistinctFromEmpty,
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "interval", "interval"),
- },
- "randomize": { // Duration!
- Type: schema.TypeString,
- Required: true,
- ValidateDiagFunc: validateTimeDuration,
- DiffSuppressFunc: diffSuppressTimeDurationZeroDistinctFromEmpty,
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "interval", "randomize"),
- },
- },
- },
- },
"transform": { // MonitorV2TransformScheduleInput
- Type: schema.TypeList,
- Optional: true,
- MaxItems: 1,
- ExactlyOneOf: []string{"scheduling.0.interval", "scheduling.0.transform"},
- Description: descriptions.Get("monitorv2", "schema", "scheduling", "transform", "description"),
+ Type: schema.TypeList,
+ Optional: true,
+ MaxItems: 1,
+ Description: descriptions.Get("monitorv2", "schema", "scheduling", "transform", "description"),
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"freshness_goal": { // Duration!
diff --git a/observe/resource_monitor_v2_action_test.go b/observe/resource_monitor_v2_action_test.go
index 2b7a8fed..870d198d 100644
--- a/observe/resource_monitor_v2_action_test.go
+++ b/observe/resource_monitor_v2_action_test.go
@@ -9,7 +9,6 @@ import (
)
func TestAccObserveMonitorV2ActionEmail(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -47,9 +46,8 @@ func TestAccObserveMonitorV2ActionEmail(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
actions {
@@ -95,7 +93,6 @@ func TestAccObserveMonitorV2ActionEmail(t *testing.T) {
}
func TestAccObserveMonitorV2ActionWebhook(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -133,9 +130,8 @@ func TestAccObserveMonitorV2ActionWebhook(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
actions {
@@ -181,7 +177,6 @@ func TestAccObserveMonitorV2ActionWebhook(t *testing.T) {
}
func TestAccObserveMonitorV2MultipleActionsEmail(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -219,9 +214,8 @@ func TestAccObserveMonitorV2MultipleActionsEmail(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
actions {
diff --git a/observe/resource_monitor_v2_test.go b/observe/resource_monitor_v2_test.go
index 2da4a65b..d4a998b3 100644
--- a/observe/resource_monitor_v2_test.go
+++ b/observe/resource_monitor_v2_test.go
@@ -11,7 +11,6 @@ import (
var monitorV2ConfigPreamble = configPreamble + datastreamConfigPreamble
func TestAccObserveMonitorV2Count(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -49,9 +48,8 @@ func TestAccObserveMonitorV2Count(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal= "15m"
}
}
}
@@ -64,8 +62,7 @@ func TestAccObserveMonitorV2Count(t *testing.T) {
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.level", "informational"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.count.0.compare_values.0.compare_fn", "greater"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.count.0.compare_values.0.value_int64.0", "0"),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.interval.0.interval", "15m0s"),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.interval.0.randomize", "0s"),
+ resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.transform.0.freshness_goal", "15m0s"),
),
},
},
@@ -73,7 +70,6 @@ func TestAccObserveMonitorV2Count(t *testing.T) {
}
func TestAccObserveMonitorV2Threshold(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -105,9 +101,8 @@ func TestAccObserveMonitorV2Threshold(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal = "15m"
}
}
}
@@ -122,8 +117,7 @@ func TestAccObserveMonitorV2Threshold(t *testing.T) {
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.threshold.0.compare_values.0.value_int64.0", "0"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.threshold.0.value_column_name", "temp_number"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.threshold.0.aggregation", "all_of"),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.interval.0.interval", "15m0s"),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.interval.0.randomize", "0s"),
+ resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.transform.0.freshness_goal", "15m0s"),
),
},
},
@@ -131,7 +125,6 @@ func TestAccObserveMonitorV2Threshold(t *testing.T) {
}
func TestAccObserveMonitorV2Promote(t *testing.T) {
- t.Skip("Skipping until monitorv2 resource fixed to match upstream")
randomPrefix := acctest.RandomWithPrefix("tf")
resource.ParallelTest(t, resource.TestCase{
@@ -144,7 +137,7 @@ func TestAccObserveMonitorV2Promote(t *testing.T) {
workspace = data.observe_workspace.default.oid
rule_kind = "promote"
name = "%[1]s"
- lookback_time = "10s"
+ lookback_time = "0s"
inputs = {
"test" = observe_datastream.test.dataset
}
@@ -168,9 +161,8 @@ func TestAccObserveMonitorV2Promote(t *testing.T) {
}
}
scheduling {
- interval {
- interval = "15m"
- randomize = "0"
+ transform {
+ freshness_goal= "15m"
}
}
}
@@ -178,14 +170,13 @@ func TestAccObserveMonitorV2Promote(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("observe_monitor_v2.first", "workspace"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "name", randomPrefix),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "lookback_time", "10s"),
+ resource.TestCheckResourceAttr("observe_monitor_v2.first", "lookback_time", "0s"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rule_kind", "promote"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.level", "informational"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.promote.0.compare_columns.0.compare_values.0.compare_fn", "greater"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.promote.0.compare_columns.0.compare_values.0.value_int64.0", "1"),
resource.TestCheckResourceAttr("observe_monitor_v2.first", "rules.0.promote.0.compare_columns.0.column.0.column_path.0.name", "temp_number"),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.interval.0.interval", "15m0s"),
- resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.interval.0.randomize", "0s"),
+ resource.TestCheckResourceAttr("observe_monitor_v2.first", "scheduling.0.transform.0.freshness_goal", "15m0s"),
),
},
},