Skip to content

Commit

Permalink
Merge branch 'main' into add_cost_cred_for_google-#218
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-br committed Mar 27, 2022
2 parents 08e0522 + 75c487f commit 7089a18
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
12 changes: 11 additions & 1 deletion docs/resources/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ description: |-
## Example Usage

```terraform
resource "env0_notification" "example" {
resource "env0_project" "example_project" {
name = "project-example"
}
resource "env0_notification" "example_notification" {
name = "notification-example"
type = "Slack"
value = "https://www.slack.com/example/webhook"
}
resource "env0_notification_project_assignment" "test_assignment" {
project_id = env0_project.example_project.id
notification_endpoint_id = env0_notification.example_notification.id
event_names = ["environmentMarkedForAutoDestroy", "deploymentCancelled"]
}
```

<!-- schema generated by tfplugindocs -->
Expand Down
12 changes: 11 additions & 1 deletion examples/resources/env0_notification/resource.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
resource "env0_notification" "example" {
resource "env0_project" "example_project" {
name = "project-example"
}

resource "env0_notification" "example_notification" {
name = "notification-example"
type = "Slack"
value = "https://www.slack.com/example/webhook"
}

resource "env0_notification_project_assignment" "test_assignment" {
project_id = env0_project.example_project.id
notification_endpoint_id = env0_notification.example_notification.id
event_names = ["environmentMarkedForAutoDestroy", "deploymentCancelled"]
}
11 changes: 11 additions & 0 deletions tests/integration/017_notification/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,14 @@ resource "env0_notification" "test_notification" {
type = var.second_run ? "Slack" : "Teams"
value = var.second_run ? "https://someotherurl.com" : "https://someurl.com"
}

resource "env0_project" "test_project" {
name = "Test-Project-For-Notification"
description = "Test Description"
}

resource "env0_notification_project_assignment" "test_assignment" {
project_id = env0_project.test_project.id
notification_endpoint_id = env0_notification.test_notification.id
event_names = var.second_run ? ["deploymentCancelled"] : ["environmentMarkedForAutoDestroy"]
}

0 comments on commit 7089a18

Please sign in to comment.