Skip to content

Commit

Permalink
Merge pull request #140 from josephpage/docs-more-examples
Browse files Browse the repository at this point in the history
docs: add example(s) to notifier resource and region data-source
  • Loading branch information
Soulou authored Mar 3, 2023
2 parents cd99f4c + a3ea587 commit 2ce5980
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
10 changes: 10 additions & 0 deletions docs/data-sources/region.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ description: |-

Scalingo Region metadata

## Example Usage

```terraform
data "scalingo_region" "osc-fr1" {
name = "osc-fr1"
}
output "scalingo_dashboard" {
value = scalingo_region.osc-fr1.dashboard
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
27 changes: 25 additions & 2 deletions docs/resources/notifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,34 @@ data_source "scalingo_notification_platform" "slack" {
# application
resource "scalingo_notifier" "all_events" {
app = scalingo_app.test_app.id
name = "Slack Audit Notifier"
platform_id = data_source.scalingo_notification_platform.slack.id
webhook_id = "https://hooks.slack.com/services/..."
active = true
send_all_events = true
webhook_url = "https://hooks.slack.com/services/..."
}
# Create a notifier to get emails for all alerts and only selected critical
# events on the application
data_source "scalingo_notification_platform" "email" {
name = "email"
}
resource "scalingo_notifier" "all_events" {
app = scalingo_app.test_app.id
name = "Email Audit Notifier"
send_all_events = true
platform_id = data_source.scalingo_notification_platform.email.id
send_all_alerts = true
selected_events = [
"addon_deleted",
"addon_suspended",
"app_crashed_repeated",
"domain_removed",
"notifier_removed",
"variable_removed",
]
emails = ["[email protected]"]
}
```
Expand Down
7 changes: 7 additions & 0 deletions examples/data-sources/scalingo_region/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "scalingo_region" "osc-fr1" {
name = "osc-fr1"
}

output "scalingo_dashboard" {
value = scalingo_region.osc-fr1.dashboard
}
27 changes: 25 additions & 2 deletions examples/resources/scalingo_notifier/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,33 @@ data_source "scalingo_notification_platform" "slack" {
# application
resource "scalingo_notifier" "all_events" {
app = scalingo_app.test_app.id
name = "Slack Audit Notifier"
platform_id = data_source.scalingo_notification_platform.slack.id
webhook_id = "https://hooks.slack.com/services/..."

active = true
send_all_events = true
webhook_url = "https://hooks.slack.com/services/..."
}

# Create a notifier to get emails for all alerts and only selected critical
# events on the application
data_source "scalingo_notification_platform" "email" {
name = "email"
}

resource "scalingo_notifier" "all_events" {
app = scalingo_app.test_app.id
name = "Email Audit Notifier"
send_all_events = true
platform_id = data_source.scalingo_notification_platform.email.id

send_all_alerts = true
selected_events = [
"addon_deleted",
"addon_suspended",
"app_crashed_repeated",
"domain_removed",
"notifier_removed",
"variable_removed",
]
emails = ["[email protected]"]
}

0 comments on commit 2ce5980

Please sign in to comment.