Skip to content

Commit

Permalink
GS-498: Support imports on alerts and services (#21)
Browse files Browse the repository at this point in the history
* Support imports on alerts and services

* Update docs for importation on alerts/services
  • Loading branch information
solarchad committed Oct 10, 2019
1 parent d3be941 commit 073cef4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions appoptics/resource_appoptics_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ func resourceAppOpticsAlert() *schema.Resource {
Read: resourceAppOpticsAlertRead,
Update: resourceAppOpticsAlertUpdate,
Delete: resourceAppOpticsAlertDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"name": {
Expand Down
3 changes: 3 additions & 0 deletions appoptics/resource_appoptics_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func resourceAppOpticsService() *schema.Resource {
Read: resourceAppOpticsServiceRead,
Update: resourceAppOpticsServiceUpdate,
Delete: resourceAppOpticsServiceDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},

Schema: map[string]*schema.Schema{
"type": {
Expand Down
8 changes: 8 additions & 0 deletions website/docs/r/alert.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ Conditions (`condition`) support the following:
Attributes (`attributes`) support the following:

* `runbook_url` - a URL for the runbook to be followed when this alert is firing. Used in the AppOptics UI if set.

## Import

Alerts can be imported using the `id`, e.g.

```
$ terraform import appoptics_alert.foobar 13581321
```
8 changes: 8 additions & 0 deletions website/docs/r/service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ The following attributes are exported:
* `type` - The type of notificaion.
* `title` - The alert title.
* `settings` - a JSON hash of settings specific to the alert type.

## Import

Services can be imported using the `id`, e.g.

```
$ terraform import appoptics_service.foobar 13581321
```

0 comments on commit 073cef4

Please sign in to comment.