diff --git a/CHANGELOG.md b/CHANGELOG.md index b078479..925966d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.5.0 (November 7, 2024) +ENHANCEMENTS +* Adds support for alert endpoints + ## 2.4.5 (October 17, 2024) BUGFIX * `ns1-go` client version bump to allow wiping out record regions diff --git a/examples/alert.tf b/examples/alert.tf index faebc0e..90c4b4d 100644 --- a/examples/alert.tf +++ b/examples/alert.tf @@ -6,7 +6,7 @@ resource "ns1_alert" "email_on_zone_transfer_failure" { zone_names = [ns1_zone.alert_example_one.zone, ns1_zone.alert_example_two.zone] } -# Nofitication list +# Notification list resource "ns1_notifylist" "email_list" { name = "email list" notifications { diff --git a/ns1/config.go b/ns1/config.go index 2e4bd2e..90d1e2f 100644 --- a/ns1/config.go +++ b/ns1/config.go @@ -19,7 +19,7 @@ import ( ) var ( - clientVersion = "2.4.5" + clientVersion = "2.5.0" providerUserAgent = "tf-ns1" + "/" + clientVersion defaultRetryMax = 3 ) diff --git a/website/docs/r/alert.html.markdown b/website/docs/r/alert.html.markdown new file mode 100644 index 0000000..b1905df --- /dev/null +++ b/website/docs/r/alert.html.markdown @@ -0,0 +1,55 @@ +--- +layout: "ns1" +page_title: "NS1: ns1_alert" +sidebar_current: "docs-ns1-resource-alert" +description: |- + Provides a NS1 Alert resource. +--- + +# ns1\_alert + +Provides a NS1 Alert resource. This can be used to create, modify, and delete alerts. + +## Example Usage + +```hcl +resource "ns1_alert" "example" { + #required + name = "Example Alert" + type = "zone" + subtype = "transfer_failed" + + #optional + notification_lists = [] + zone_names = [] + record_ids = [] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The free-form display name for the alert. +* `type` - (Required) The type of the alert. +* `subtype` - (Required) The type of the alert. +* `notification_lists` - (Optional) A list of id's for notification lists whose notifiers will be triggered by the alert. +* `zone_names` - (Optional) A list of zones this alert applies to. +* `record_ids` - (Optional) A list of record id's this alert applies to. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `created_by` - (Read Only) The user or apikey that created this alert. +* `updated_by` - (Read Only) The user or apikey that last modified this alert. +* `created_at` - (Read Only) The Unix timestamp representing when the alert configuration was created. +* `updated_at` - (Read Only) The Unix timestamp representing when the alert configuration was last modified. + +## Import + +`terraform import ns1_alert. ` + +## NS1 Documentation + +[Alerts Api Doc](https://ns1.com/api#alerts) diff --git a/website/ns1.erb b/website/ns1.erb index 5933bbd..f963029 100644 --- a/website/ns1.erb +++ b/website/ns1.erb @@ -61,6 +61,9 @@ > ns1_user + > + ns1_alert +