diff --git a/sql/resource_alert.go b/sql/resource_alert.go index 4bd7c7b20..16022548a 100644 --- a/sql/resource_alert.go +++ b/sql/resource_alert.go @@ -38,7 +38,7 @@ func ResourceAlert() common.Resource { strings.TrimPrefix(f, "condition.0.threshold.0.value.0.")).SetExactlyOneOf(alof) } common.CustomizeSchemaPath(m, "owner_user_name").SetSuppressDiff() - common.CustomizeSchemaPath(m, "notify_on_ok").SetSuppressDiff() + common.CustomizeSchemaPath(m, "notify_on_ok").SetDefault(true) common.CustomizeSchemaPath(m, "id").SetReadOnly() common.CustomizeSchemaPath(m, "create_time").SetReadOnly() common.CustomizeSchemaPath(m, "lifecycle_state").SetReadOnly() diff --git a/sql/resource_alert_test.go b/sql/resource_alert_test.go index e3bf93e8c..31ef7ed05 100644 --- a/sql/resource_alert_test.go +++ b/sql/resource_alert_test.go @@ -32,6 +32,7 @@ var ( }, }, ParentPath: "/Workspace/Shared/Alerts", + NotifyOnOk: true, } createHcl = `query_id = "123456" display_name = "TF new alert" @@ -55,6 +56,7 @@ var ( QueryId: "123456", DisplayName: "TF new alert", ParentPath: "/Shared/Alerts", + NotifyOnOk: true, Condition: &sql.AlertCondition{ Op: "GREATER_THAN", Operand: &sql.AlertConditionOperand{ @@ -195,6 +197,7 @@ func TestAlertUpdate(t *testing.T) { QueryId: "123456", DisplayName: "TF new alert", OwnerUserName: "user@domain.com", + NotifyOnOk: false, Condition: &sql.AlertCondition{ Op: "GREATER_THAN", Operand: &sql.AlertConditionOperand{ @@ -224,6 +227,7 @@ func TestAlertUpdate(t *testing.T) { HCL: `query_id = "123456" display_name = "TF new alert" owner_user_name = "user@domain.com" + notify_on_ok = false condition { op = "GREATER_THAN" operand {