Skip to content

Commit

Permalink
feat(alert-muting-rule): update end_behaviour attribute to action_on_…
Browse files Browse the repository at this point in the history
…muting_rule_window_ended and validation method
  • Loading branch information
Aashirwadjain committed Dec 19, 2024
1 parent 7ff91ed commit 8e35db1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions newrelic/resource_newrelic_alert_muting_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package newrelic
import (
"context"
"fmt"
"github.com/newrelic/newrelic-client-go/v2/pkg/alerts"
"log"
"regexp"
"time"
Expand Down Expand Up @@ -183,11 +184,17 @@ func resourceNewRelicAlertMutingRule() *schema.Resource {
Elem: scheduleSchema(),
Description: "The time window when the MutingRule should actively mute incidents.",
},
"end_behaviour": {
Type: schema.TypeString,
Optional: true,
Description: "The action when the muting rule window is ended or disabled.",
ValidateFunc: validation.StringInSlice([]string{"CLOSE_ISSUES_ON_INACTIVE", "DO_NOTHING"}, false),
"action_on_muting_rule_window_ended": {
Type: schema.TypeString,
Optional: true,
Description: "The action when the muting rule window is ended or disabled.",
ValidateFunc: validation.StringInSlice(
[]string{
string(alerts.AlertsActionOnMutingRuleWindowEndedTypes.CLOSE_ISSUES_ON_INACTIVE),
string(alerts.AlertsActionOnMutingRuleWindowEndedTypes.DO_NOTHING),
},
false,
),
},
},
}
Expand Down

0 comments on commit 8e35db1

Please sign in to comment.