Skip to content

Commit

Permalink
Merge pull request #3032 from Cyb3r-Jak3/notification-policy-revert-e…
Browse files Browse the repository at this point in the history
…xactlyoneof

Revert ExactlyOneOf for notification_policy
  • Loading branch information
jacobbednarz authored Dec 28, 2023
2 parents abc38a1 + 3097a39 commit f00607a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .changelog/3032.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cloudflare_notification_policy: revert `ExactlyOneOf`
```
6 changes: 3 additions & 3 deletions docs/resources/notification_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ resource "cloudflare_notification_policy" "example" {
### Optional

- `description` (String) Description of the notification policy.
- `email_integration` (Block Set) The email id to which the notification should be dispatched. One of email, webhooks, or PagerDuty mechanisms is required. Must provide only one of `email_integration`, `webhooks_integration`, `pagerduty_integration`. (see [below for nested schema](#nestedblock--email_integration))
- `email_integration` (Block Set) The email ID to which the notification should be dispatched. (see [below for nested schema](#nestedblock--email_integration))
- `filters` (Block List, Max: 1) An optional nested block of filters that applies to the selected `alert_type`. A key-value map that specifies the type of filter and the values to match against (refer to the alert type block for available fields). (see [below for nested schema](#nestedblock--filters))
- `pagerduty_integration` (Block Set) The unique id of a configured pagerduty endpoint to which the notification should be dispatched. One of email, webhooks, or PagerDuty mechanisms is required. Must provide only one of `email_integration`, `webhooks_integration`, `pagerduty_integration`. (see [below for nested schema](#nestedblock--pagerduty_integration))
- `webhooks_integration` (Block Set) The unique id of a configured webhooks endpoint to which the notification should be dispatched. One of email, webhooks, or PagerDuty mechanisms is required. Must provide only one of `email_integration`, `webhooks_integration`, `pagerduty_integration`. (see [below for nested schema](#nestedblock--webhooks_integration))
- `pagerduty_integration` (Block Set) The unique ID of a configured pagerduty endpoint to which the notification should be dispatched. (see [below for nested schema](#nestedblock--pagerduty_integration))
- `webhooks_integration` (Block Set) The unique ID of a configured webhooks endpoint to which the notification should be dispatched. (see [below for nested schema](#nestedblock--webhooks_integration))

### Read-Only

Expand Down
27 changes: 12 additions & 15 deletions internal/sdkv2provider/schema_cloudflare_notification_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,22 @@ func resourceCloudflareNotificationPolicySchema() map[string]*schema.Schema {
Description: "When the notification policy was last modified.",
},
"email_integration": {
Type: schema.TypeSet,
Optional: true,
Elem: mechanismData,
ExactlyOneOf: []string{"email_integration", "webhooks_integration", "pagerduty_integration"},
Description: "The email id to which the notification should be dispatched. One of email, webhooks, or PagerDuty mechanisms is required.",
Type: schema.TypeSet,
Optional: true,
Elem: mechanismData,
Description: "The email ID to which the notification should be dispatched.",
},
"webhooks_integration": {
Type: schema.TypeSet,
Optional: true,
Elem: mechanismData,
ExactlyOneOf: []string{"email_integration", "webhooks_integration", "pagerduty_integration"},
Description: "The unique id of a configured webhooks endpoint to which the notification should be dispatched. One of email, webhooks, or PagerDuty mechanisms is required.",
Type: schema.TypeSet,
Optional: true,
Elem: mechanismData,
Description: "The unique ID of a configured webhooks endpoint to which the notification should be dispatched.",
},
"pagerduty_integration": {
Type: schema.TypeSet,
Optional: true,
Elem: mechanismData,
ExactlyOneOf: []string{"email_integration", "webhooks_integration", "pagerduty_integration"},
Description: "The unique id of a configured pagerduty endpoint to which the notification should be dispatched. One of email, webhooks, or PagerDuty mechanisms is required.",
Type: schema.TypeSet,
Optional: true,
Elem: mechanismData,
Description: "The unique ID of a configured pagerduty endpoint to which the notification should be dispatched.",
},
}
}
Expand Down

0 comments on commit f00607a

Please sign in to comment.