-
Notifications
You must be signed in to change notification settings - Fork 193
TF-33257 HCP Terraform & Enterprise Docs Update Notification Configurations for Projects #1630
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
Merged
trujillo-adam
merged 13 commits into
main
from
jillirami/tf-33257-update-project-notification-documentation
Apr 3, 2026
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8aebc16
Update notification configuration docs for projects
jillirami b29dd89
Split notification configuration API docs
cgriggs01 025c3cd
Add project notificiation documentation
cgriggs01 267c07d
restructure notifications API docs
trujillo-adam bd8df63
fix exclusions
trujillo-adam 0fb3a5b
update changelog
trujillo-adam 67be72f
restructure notifications API docs (#2125)
trujillo-adam d8d5ff3
include workspace exclusion details
cgriggs01 ebe2d8d
Apply suggestions from code review
trujillo-adam e41d92b
fix merge conflicts
trujillo-adam 5f19f9a
fix conflict
trujillo-adam 0148976
wrong tfe version for proj notifications
trujillo-adam b15b60e
Apply suggestions from code review
trujillo-adam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
...form-docs-common/docs/cloud-docs/api-docs/notification-configurations/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| --- | ||
| page_title: Notification configurations API reference for HCP Terraform | ||
| description: >- | ||
| Use the HCP Terraform API's notification configuration endpoints to manage notifications for workspaces, projects, and teams. | ||
| tfc_only: true | ||
| --- | ||
|
|
||
| [JSON API document]: /terraform/cloud-docs/api-docs#json-api-documents | ||
| [JSON API error object]: https://jsonapi.org/format/#error-objects | ||
|
|
||
| # Notification configurations API reference | ||
|
|
||
| Use the notifications API endpoints for workspaces, projects, and teams to send notifications to external applications when a triggering event occurs. | ||
|
|
||
| ## Notification types | ||
|
|
||
| HCP Terraform supports the following types of notification configurations. | ||
|
|
||
| ### Workspace notification configurations | ||
|
|
||
| Workspace notifications send alerts for run state transitions and workspace-specific events. Each workspace can have up to 20 notification configurations that apply to all runs for that workspace. Use workspace notifications to in the following cases: | ||
|
|
||
| - Monitor run status changes | ||
| - Track drift detection and continuous validation results | ||
| - Receive alerts for health assessment failures | ||
| - Get notified about automatic destroy runs | ||
|
|
||
| Refer to [Workspace notification configurations API reference](/terraform/cloud-docs/api-docs/notification-configurations/workspace) for more information. | ||
|
|
||
| ### Project notification configurations | ||
|
|
||
| Project notifications allow you to configure notifications for an entire project instead of setting them up for individual workspaces. These notifications automatically apply to every workspace in the project, making it easier to maintain consistent notification settings across multiple workspaces. Use project notifications to in the following cases: | ||
|
|
||
| - Standardize notifications across all workspaces in a project | ||
| - Reduce configuration overhead for large projects | ||
| - Ensure consistent monitoring for related workspaces | ||
|
|
||
| Refer to [Project notification configurations API reference](/terraform/cloud-docs/api-docs/notification-configurations/project) for more information. | ||
|
|
||
| ### Team notification configurations | ||
|
|
||
| Team notifications send alerts to specific teams when relevant events occur. By default, every team has a default email notification configuration. If no users are assigned to a notification configuration, HCP Terraform sends email notifications to all team members. Use team notifications to in the following cases: | ||
|
|
||
| - Notify teams about change requests for workspaces they can access | ||
| - Route notifications to appropriate team channels | ||
| - Manage team-specific alert preferences | ||
|
|
||
| Refer to [Project notification configurations API reference](/terraform/cloud-docs/api-docs/notification-configurations/team) | ||
|
|
||
| ## Destination types | ||
|
|
||
| All notification configurations support the following destination types: | ||
|
|
||
| | Destination Type | Description | | ||
| | --- | --- | | ||
| | `generic` | Send JSON payloads to any HTTP/HTTPS endpoint. Supports HMAC authentication. | | ||
| | `email` | Send email notifications to specified users or all members. | | ||
| | `slack` | Send formatted messages to Slack channels using webhook URLs. | | ||
| | `microsoft-teams` | Send formatted messages to Microsoft Teams channels using webhook URLs. | | ||
|
|
||
| ## Notification authenticity | ||
|
|
||
| For `generic` destination types, HCP Terraform provides an HMAC signature on all notification requests using the configured `token` as the key. This signature is sent in the `X-TFE-Notification-Signature` header using the SHA-512 digest algorithm. Notification target servers should verify the source of HTTP requests by computing the HMAC of the request body using the same shared secret and dropping any requests with invalid signatures. | ||
|
|
||
| Sample Ruby code for verifying the HMAC: | ||
|
|
||
| ```ruby | ||
| token = SecureRandom.hex | ||
| hmac = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha512"), token, @request.body) | ||
| fail "Invalid HMAC" if hmac != @request.headers["X-TFE-Notification-Signature"] | ||
| ``` | ||
|
|
||
| ## Notification verification | ||
|
|
||
| When saving a configuration with `enabled` set to `true`, or when using the verify API endpoint, HCP Terraform sends a verification request to the configured URL. The response to this request is stored and available in the `delivery-responses` array of the `notification-configuration` resource. | ||
|
|
||
| HCP Terraform cannot enable configurations if the verification request fails. An HTTP response with a status code of `2xx` indicates success. You can only verify configurations with `destination_type` set to `email` manually, and they do not require an HTTP response. | ||
|
|
||
| ## Delivery responses | ||
|
|
||
| Each delivery response contains several fields that provide information about the notification attempt: | ||
|
|
||
| | Name | Type | Description | | ||
| | --- | --- | --- | | ||
| | `body` | string | Response body (may be truncated). | | ||
| | `code` | string | HTTP status code, e.g., `400`. | | ||
| | `headers` | object | All HTTP headers received, represented as an object with keys for each header name (lowercased) and an array of string values. | | ||
| | `sent-at` | date | The UTC timestamp when the notification was sent. | | ||
| | `successful` | bool | Whether HCP Terraform considers this response to be successful. | | ||
| | `url` | string | The URL to which the request was sent. | | ||
|
|
||
| ## Permissions | ||
|
|
||
| You must have the following permissions to interact with the notifications API: | ||
|
|
||
| - **Workspace notifications**: Admin access to the relevant workspace | ||
| - **Project notifications**: Admin access to the relevant project | ||
| - **Team notifications**: Appropriate team management permissions | ||
|
|
||
| Refer to [HCP Terraform permissions documentation](/terraform/cloud-docs/users-teams-organizations/permissions) for more details. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create a subbranch to propose some structural changes that I think will set us up better for future work