Skip to content

Commit

Permalink
- Add docs.
Browse files Browse the repository at this point in the history
- Update version.
  • Loading branch information
hhellyer committed Nov 7, 2024
1 parent 02f31b8 commit 51dd019
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/alert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ns1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

var (
clientVersion = "2.4.5"
clientVersion = "2.5.0"
providerUserAgent = "tf-ns1" + "/" + clientVersion
defaultRetryMax = 3
)
Expand Down
55 changes: 55 additions & 0 deletions website/docs/r/alert.html.markdown
Original file line number Diff line number Diff line change
@@ -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.<name> <alert_id>`

## NS1 Documentation

[Alerts Api Doc](https://ns1.com/api#alerts)
3 changes: 3 additions & 0 deletions website/ns1.erb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<li<%= sidebar_current("docs-ns1-resource-redirect") %>>
<a href="/docs/providers/ns1/r/redirect.html">ns1_user</a>
</li>
<li<%= sidebar_current("docs-ns1-resource-alert") %>>
<a href="/docs/providers/ns1/r/alert.html">ns1_alert</a>
</li>
</ul>
</li>
</ul>
Expand Down

0 comments on commit 51dd019

Please sign in to comment.