|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "dependencytrack_notification_rule Resource - dependencytrack" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Manages a Notification Rule. |
| 7 | +--- |
| 8 | + |
| 9 | +# dependencytrack_notification_rule (Resource) |
| 10 | + |
| 11 | +Manages a Notification Rule. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +# Look up the Outbound Webhook publisher |
| 17 | +data "dependencytrack_notification_publisher" "webhook" { |
| 18 | + name = "Outbound Webhook" |
| 19 | +} |
| 20 | +
|
| 21 | +# Event-driven notification rule for new vulnerabilities |
| 22 | +resource "dependencytrack_notification_rule" "vuln_webhook" { |
| 23 | + name = "Vulnerability Webhook" |
| 24 | + scope = "PORTFOLIO" |
| 25 | + notification_level = "INFORMATIONAL" |
| 26 | + publisher_id = data.dependencytrack_notification_publisher.webhook.id |
| 27 | + notify_on = ["NEW_VULNERABILITY", "NEW_VULNERABLE_DEPENDENCY"] |
| 28 | + publisher_config = jsonencode({ destination = "https://example.com/webhook" }) |
| 29 | +} |
| 30 | +
|
| 31 | +# Scheduled notification rule for daily vulnerability summary |
| 32 | +resource "dependencytrack_notification_rule" "daily_summary" { |
| 33 | + name = "Daily Vulnerability Summary" |
| 34 | + scope = "PORTFOLIO" |
| 35 | + notification_level = "INFORMATIONAL" |
| 36 | + trigger_type = "SCHEDULE" |
| 37 | + publisher_id = data.dependencytrack_notification_publisher.webhook.id |
| 38 | + notify_on = ["NEW_VULNERABILITIES_SUMMARY"] |
| 39 | + schedule_cron = "0 8 * * *" |
| 40 | + schedule_skip_unchanged = true |
| 41 | + publisher_config = jsonencode({ destination = "https://example.com/webhook" }) |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +<!-- schema generated by tfplugindocs --> |
| 46 | +## Schema |
| 47 | + |
| 48 | +### Required |
| 49 | + |
| 50 | +- `name` (String) Name of the Notification Rule. |
| 51 | +- `publisher_id` (String) UUID for the Notification Publisher to use. |
| 52 | +- `scope` (String) Scope of the Notification Rule. Valid values are 'SYSTEM' and 'PORTFOLIO'. |
| 53 | + |
| 54 | +### Optional |
| 55 | + |
| 56 | +- `enabled` (Boolean) Whether the Notification Rule is enabled. Defaults to `true`. |
| 57 | +- `log_successful_publish` (Boolean) Whether to log successful notification publishes. Defaults to `false`. |
| 58 | +- `message` (String) Custom message for the notification. Maximum 1024 characters. |
| 59 | +- `notification_level` (String) Notification level threshold. Valid values are 'INFORMATIONAL', 'WARNING', 'ERROR'. |
| 60 | +- `notify_children` (Boolean) Whether to also notify for child projects. Defaults to `true`. |
| 61 | +- `notify_on` (Set of String) Set of notification group names to notify on. For PORTFOLIO scope: NEW_VULNERABILITY, NEW_VULNERABLE_DEPENDENCY, PROJECT_AUDIT_CHANGE, BOM_CONSUMED, BOM_PROCESSED, BOM_PROCESSING_FAILED, BOM_VALIDATION_FAILED, VEX_CONSUMED, VEX_PROCESSED, POLICY_VIOLATION, PROJECT_CREATED, USER_CREATED, USER_DELETED. For PORTFOLIO scheduled: NEW_VULNERABILITIES_SUMMARY, NEW_POLICY_VIOLATIONS_SUMMARY. For SYSTEM scope: CONFIGURATION, DATASOURCE_MIRRORING, REPOSITORY, INTEGRATION, INDEXING_SERVICE, FILE_SYSTEM, ANALYZER. |
| 62 | +- `publisher_config` (String) Publisher-specific configuration (e.g. webhook URL, email address). Typically JSON. |
| 63 | +- `schedule_cron` (String) Cron expression for scheduled notifications. Only applicable when trigger_type is 'SCHEDULE'. |
| 64 | +- `schedule_skip_unchanged` (Boolean) Whether to skip sending scheduled notifications when there are no changes. Only applicable when trigger_type is 'SCHEDULE'. Defaults to `false`. |
| 65 | +- `trigger_type` (String) Trigger type for the Notification Rule. Valid values are 'EVENT' and 'SCHEDULE'. Defaults to 'EVENT'. |
| 66 | + |
| 67 | +### Read-Only |
| 68 | + |
| 69 | +- `id` (String) UUID for the Notification Rule as generated by DependencyTrack. |
| 70 | + |
| 71 | +## Import |
| 72 | + |
| 73 | +Import is supported using the following syntax: |
| 74 | + |
| 75 | +```shell |
| 76 | +terraform import dependencytrack_notification_rule.example <notification-rule-uuid> |
| 77 | +``` |
0 commit comments