Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GS-498: Support imports on alerts and services #21

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```