Skip to content

Commit

Permalink
Add assessment triggers to notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
lawliet89 authored and brandonc committed Nov 18, 2022
1 parent 8fc8adb commit c512607
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions tfe/resource_tfe_notification_configuration.go
Expand Up @@ -81,6 +81,8 @@ func resourceTFENotificationConfiguration() *schema.Resource {
string(tfe.NotificationTriggerApplying),
string(tfe.NotificationTriggerCompleted),
string(tfe.NotificationTriggerErrored),
string(tfe.NotificationTriggerAssessmentDrifted),
string(tfe.NotificationTriggerAssessmentFailed),
},
false,
),
Expand Down
19 changes: 10 additions & 9 deletions website/docs/r/notification_configuration.html.markdown
Expand Up @@ -8,8 +8,8 @@ description: |-

# tfe_notification_configuration

Terraform Cloud can be configured to send notifications for run state transitions.
Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification.
Terraform Cloud can be configured to send notifications for run state transitions.
Notification configurations allow you to specify a URL, destination type, and what events will trigger the notification.
Each workspace can have up to 20 notification configurations, and they apply to all runs for that workspace.


Expand Down Expand Up @@ -100,15 +100,15 @@ resource "tfe_notification_configuration" "test" {
The following arguments are supported:

* `name` - (Required) Name of the notification configuration.
* `destination_type` - (Required) The type of notification configuration payload to send.
* `destination_type` - (Required) The type of notification configuration payload to send.
Valid values are:
* `generic`
* `email` available in Terraform Cloud or Terraform Enterprise v202005-1 or later
* `slack`
* `microsoft-teams` available in Terraform Cloud or Terraform Enterprise v202206-1 or later
* `email_addresses` - (Optional) **TFE only** A list of email addresses. This value
* `email_addresses` - (Optional) **TFE only** A list of email addresses. This value
_must not_ be provided if `destination_type` is `generic`, `microsoft-teams`, or `slack`.
* `email_user_ids` - (Optional) A list of user IDs. This value _must not_ be provided
* `email_user_ids` - (Optional) A list of user IDs. This value _must not_ be provided
if `destination_type` is `generic`, `microsoft-teams`, or `slack`.
* `enabled` - (Optional) Whether the notification configuration should be enabled or not.
Disabled configurations will not send any notifications. Defaults to `false`.
Expand All @@ -118,11 +118,12 @@ The following arguments are supported:
This value _must not_ be provided if `destination_type` is `email`, `microsoft-teams`, or `slack`.
* `triggers` - (Optional) The array of triggers for which this notification configuration will
send notifications. Valid values are `run:created`, `run:planning`, `run:needs_attention`, `run:applying`
`run:completed`, `run:errored`. If omitted, no notification triggers are configured.
* `url` - (Required if `destination_type` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification
configuration where notification requests will be made. This value _must not_ be provided if `destination_type`
`run:completed`, `run:errored`, `assessment:drifted`, or `assessment:failed`.
If omitted, no notification triggers are configured.
* `url` - (Required if `destination_type` is `generic`, `microsoft-teams`, or `slack`) The HTTP or HTTPS URL of the notification
configuration where notification requests will be made. This value _must not_ be provided if `destination_type`
is `email`.
* `workspace_id` - (Required) The id of the workspace that owns the notification configuration.
* `workspace_id` - (Required) The id of the workspace that owns the notification configuration.

## Attributes Reference

Expand Down

0 comments on commit c512607

Please sign in to comment.