Skip to content

Commit 3bb593c

Browse files
akshat-goyal-harnessHarness
authored andcommitted
feat: [PL-65922]: Updating Example and doc for pipeline central notification rule (#1304)
* 0f84de #docChanges * 2d6712 #example
1 parent a662fba commit 3bb593c

File tree

5 files changed

+85
-5
lines changed

5 files changed

+85
-5
lines changed

docs/data-sources/platform_pipeline_central_notification_rule.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Data source for retrieving a Notification Rule.
2727
- `notification_conditions` (Block List) (see [below for nested schema](#nestedblock--notification_conditions))
2828
- `org` (String) Identifier of the organization in which the Notification Rule is configured.
2929
- `project` (String) Identifier of the project in which the Notification Rule is configured.
30-
- `status` (String)
31-
30+
- `status` (String) Status of the notification rule. Supported values: `ENABLED`, `DISABLED`. Default: `ENABLED`.
3231
### Read-Only
3332

3433
- `account` (String) Account identifier associated with this notification channel.
@@ -76,7 +75,7 @@ Required:
7675
Required:
7776

7877
- `notification_entity` (String)
79-
- `notification_event` (String)
78+
- `notification_event` (String) The pipeline event that triggers the notification. Supported values: `PIPELINE_START`, `PIPELINE_SUCCESS`, `PIPELINE_FAILED`, `STAGE_START`, `STAGE_SUCCESS`, `STAGE_FAILED`.
8079

8180
Optional:
8281

docs/resources/platform_pipeline_central_notification_rule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Resource for creating a Harness Notification Rule for Pipeline
2727
- `name` (String)
2828
- `org` (String)
2929
- `project` (String)
30-
- `status` (String)
30+
- `status` (String) Status of the notification rule. Supported values: `ENABLED`, `DISABLED`. Default: `ENABLED`.
3131

3232
### Read-Only
3333

@@ -50,7 +50,7 @@ Required:
5050
Required:
5151

5252
- `notification_entity` (String)
53-
- `notification_event` (String)
53+
- `notification_event` (String) The pipeline event that triggers the notification. Supported values: `PIPELINE_START`, `PIPELINE_SUCCESS`, `PIPELINE_FAILED`, `STAGE_START`, `STAGE_SUCCESS`, `STAGE_FAILED`.
5454

5555
Optional:
5656

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data "harness_platform_pipeline_central_notification_rule" "example" {
2+
identifier = "identifier"
3+
org_id = "org_id"
4+
project_id = "project_id"
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Import account level pipeline central notification rule
2+
terraform import harness_platform_pipeline_central_notification_rule.example <notification_rule_id>
3+
4+
# Import org level pipeline central notification rule
5+
terraform import harness_platform_pipeline_central_notification_rule.example <ord_id>/<notification_rule_id>
6+
7+
# Import project level pipeline central notification rule
8+
terraform import harness_platform_pipeline_central_notification_rule.example <org_id>/<project_id>/<notification_rule_id>
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
resource "harness_platform_pipeline_central_notification_rule" "projExample" {
2+
identifier = "identifier"
3+
name = "name"
4+
status = "ENABLED"
5+
notification_channel_refs = ["account.channel"]
6+
org = "default"
7+
project = "proj0"
8+
9+
notification_conditions {
10+
condition_name = "pipelineRuleProjectConditionName"
11+
12+
notification_event_configs {
13+
notification_entity = "PIPELINE"
14+
notification_event = "PIPELINE_START"
15+
16+
notification_event_data {
17+
type = "PIPELINE"
18+
scope_identifiers = []
19+
}
20+
entity_identifiers = []
21+
}
22+
}
23+
}
24+
25+
resource "harness_platform_pipeline_central_notification_rule" "orgExample" {
26+
identifier = "identifier"
27+
name = "name"
28+
status = "ENABLED"
29+
notification_channel_refs = ["channel"]
30+
org = "default"
31+
32+
notification_conditions {
33+
condition_name = "pipelineRuleOrgConditionName"
34+
35+
notification_event_configs {
36+
notification_entity = "PIPELINE"
37+
notification_event = "PIPELINE_START"
38+
39+
notification_event_data {
40+
type = "PIPELINE"
41+
scope_identifiers = ["proj0", "random"]
42+
}
43+
entity_identifiers = []
44+
}
45+
}
46+
}
47+
48+
resource "harness_platform_pipeline_central_notification_rule" "accountExample" {
49+
identifier = "identifier"
50+
name = "name"
51+
status = "DISABLED"
52+
notification_channel_refs = ["org.channel"]
53+
54+
notification_conditions {
55+
condition_name = "pipelineRuleConditionName"
56+
57+
notification_event_configs {
58+
notification_entity = "PIPELINE"
59+
notification_event = "PIPELINE_START"
60+
61+
notification_event_data {
62+
type = "PIPELINE"
63+
scope_identifiers = ["org"]
64+
}
65+
entity_identifiers = []
66+
}
67+
}
68+
}

0 commit comments

Comments
 (0)