Skip to content

Commit 69c1bd8

Browse files
feat: add resource for report groups [ENG-5559] (#92)
[ENG-5559](https://stacklet.atlassian.net/browse/ENG-5559) ### what Add reource for notification report groups. Note that notification settings for the different transports are not yet handled. They're present in the resource schema but not passed to the API. This will be added in a followup branch since this one is already quite large. ### why allow managing notifications via terraform ### testing testing in sandbox, added acceptance tests ### docs updated here [ENG-5559]: https://stacklet.atlassian.net/browse/ENG-5559?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent dee39c8 commit 69c1bd8

File tree

13 files changed

+2131
-7
lines changed

13 files changed

+2131
-7
lines changed

docs/data-sources/report_group.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Read-Only:
125125

126126
- `first_match_only` (Boolean) Only report the first match.
127127
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--slack_delivery_settings--recipients))
128-
- `template` (String) Name of the template for the email.
128+
- `template` (String) Name of the template for the notification.
129129

130130
<a id="nestedatt--slack_delivery_settings--recipients"></a>
131131
### Nested Schema for `slack_delivery_settings.recipients`
@@ -169,7 +169,7 @@ Read-Only:
169169

170170
- `first_match_only` (Boolean) Only report the first match.
171171
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--teams_delivery_settings--recipients))
172-
- `template` (String) Name of the template for the email.
172+
- `template` (String) Name of the template for the notification.
173173

174174
<a id="nestedatt--teams_delivery_settings--recipients"></a>
175175
### Nested Schema for `teams_delivery_settings.recipients`

docs/resources/report_group.md

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stacklet_report_group Resource - terraform-provider-stacklet"
4+
subcategory: ""
5+
description: |-
6+
Retrieve information about a notification report group by name.
7+
---
8+
9+
# stacklet_report_group (Resource)
10+
11+
Retrieve information about a notification report group by name.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stacklet_binding" "b1" {
17+
name = "binding-1"
18+
}
19+
20+
data "stacklet_binding" "b2" {
21+
name = "binding-2"
22+
}
23+
24+
resource "stacklet_report_group" "example" {
25+
name = "example"
26+
schedule = "0 12 * * *"
27+
bindings = [
28+
data.stacklet_binding.b1.uuid,
29+
data.stacklet_binding.b2.uuid,
30+
]
31+
group_by = ["account", "region"]
32+
}
33+
```
34+
35+
<!-- schema generated by tfplugindocs -->
36+
## Schema
37+
38+
### Required
39+
40+
- `bindings` (List of String) List of UUIDs for bindings the report group is for.
41+
- `name` (String) The name for the report group.
42+
- `schedule` (String) Notification schedule.
43+
44+
### Optional
45+
46+
- `email_delivery_settings` (Block List) Notifications delivery settings for email. (see [below for nested schema](#nestedblock--email_delivery_settings))
47+
- `enabled` (Boolean) Whether the report group is enabled.
48+
- `group_by` (List of String) Fields on which matching resources are grouped.
49+
- `jira_delivery_settings` (Block List) Notifications delivery settings for Jira. (see [below for nested schema](#nestedblock--jira_delivery_settings))
50+
- `servicenow_delivery_settings` (Block List) Notifications delivery settings for ServiceNow. (see [below for nested schema](#nestedblock--servicenow_delivery_settings))
51+
- `slack_delivery_settings` (Block List) Notifications delivery settings for Slack. (see [below for nested schema](#nestedblock--slack_delivery_settings))
52+
- `symphony_delivery_settings` (Block List) Notifications delivery settings for Symphony. (see [below for nested schema](#nestedblock--symphony_delivery_settings))
53+
- `teams_delivery_settings` (Block List) Notifications delivery settings for Microsoft Teams. (see [below for nested schema](#nestedblock--teams_delivery_settings))
54+
- `use_message_settings` (Boolean) Whether to use delivery settings from the notification message.
55+
56+
### Read-Only
57+
58+
- `id` (String) The GraphQL Node ID of the report group.
59+
60+
<a id="nestedblock--email_delivery_settings"></a>
61+
### Nested Schema for `email_delivery_settings`
62+
63+
Required:
64+
65+
- `subject` (String) Email subject.
66+
- `template` (String) Name of the template for the email.
67+
68+
Optional:
69+
70+
- `cc` (List of String) List of CC addresses.
71+
- `first_match_only` (Boolean) Only report the first match.
72+
- `format` (String) Email format (html or plain). Autodetected from the template if not specified.
73+
- `from` (String) Email from address.
74+
- `priority` (String) Email priority.
75+
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--email_delivery_settings--recipients))
76+
77+
<a id="nestedatt--email_delivery_settings--recipients"></a>
78+
### Nested Schema for `email_delivery_settings.recipients`
79+
80+
Optional:
81+
82+
- `account_owner` (Boolean) Whether to notify the account owner.
83+
- `event_owner` (Boolean) Whether to notify the event owner.
84+
- `resource_owner` (Boolean) Whether to notify the resource owner.
85+
- `tag` (String) Tag to match the resource owner from.
86+
- `value` (String) Explicit value for a notification recipient.
87+
88+
89+
90+
<a id="nestedblock--jira_delivery_settings"></a>
91+
### Nested Schema for `jira_delivery_settings`
92+
93+
Required:
94+
95+
- `description` (String) Ticket description.
96+
- `project` (String) Jira project key.
97+
- `summary` (String) Ticket summary.
98+
- `template` (String) Name of the template for the notification.
99+
100+
Optional:
101+
102+
- `first_match_only` (Boolean) Only report the first match.
103+
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--jira_delivery_settings--recipients))
104+
105+
<a id="nestedatt--jira_delivery_settings--recipients"></a>
106+
### Nested Schema for `jira_delivery_settings.recipients`
107+
108+
Optional:
109+
110+
- `account_owner` (Boolean) Whether to notify the account owner.
111+
- `event_owner` (Boolean) Whether to notify the event owner.
112+
- `resource_owner` (Boolean) Whether to notify the resource owner.
113+
- `tag` (String) Tag to match the resource owner from.
114+
- `value` (String) Explicit value for a notification recipient.
115+
116+
117+
118+
<a id="nestedblock--servicenow_delivery_settings"></a>
119+
### Nested Schema for `servicenow_delivery_settings`
120+
121+
Required:
122+
123+
- `impact` (String) Impact to use for the ticket.
124+
- `short_description` (String) Ticket description.
125+
- `template` (String) Name of the template for the notification.
126+
- `urgency` (String) Ticket urgency.
127+
128+
Optional:
129+
130+
- `first_match_only` (Boolean) Only report the first match.
131+
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--servicenow_delivery_settings--recipients))
132+
133+
<a id="nestedatt--servicenow_delivery_settings--recipients"></a>
134+
### Nested Schema for `servicenow_delivery_settings.recipients`
135+
136+
Optional:
137+
138+
- `account_owner` (Boolean) Whether to notify the account owner.
139+
- `event_owner` (Boolean) Whether to notify the event owner.
140+
- `resource_owner` (Boolean) Whether to notify the resource owner.
141+
- `tag` (String) Tag to match the resource owner from.
142+
- `value` (String) Explicit value for a notification recipient.
143+
144+
145+
146+
<a id="nestedblock--slack_delivery_settings"></a>
147+
### Nested Schema for `slack_delivery_settings`
148+
149+
Required:
150+
151+
- `template` (String) Name of the template for the notification.
152+
153+
Optional:
154+
155+
- `first_match_only` (Boolean) Only report the first match.
156+
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--slack_delivery_settings--recipients))
157+
158+
<a id="nestedatt--slack_delivery_settings--recipients"></a>
159+
### Nested Schema for `slack_delivery_settings.recipients`
160+
161+
Optional:
162+
163+
- `account_owner` (Boolean) Whether to notify the account owner.
164+
- `event_owner` (Boolean) Whether to notify the event owner.
165+
- `resource_owner` (Boolean) Whether to notify the resource owner.
166+
- `tag` (String) Tag to match the resource owner from.
167+
- `value` (String) Explicit value for a notification recipient.
168+
169+
170+
171+
<a id="nestedblock--symphony_delivery_settings"></a>
172+
### Nested Schema for `symphony_delivery_settings`
173+
174+
Required:
175+
176+
- `template` (String) Name of the template for the notification.
177+
178+
Optional:
179+
180+
- `first_match_only` (Boolean) Only report the first match.
181+
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--symphony_delivery_settings--recipients))
182+
183+
<a id="nestedatt--symphony_delivery_settings--recipients"></a>
184+
### Nested Schema for `symphony_delivery_settings.recipients`
185+
186+
Optional:
187+
188+
- `account_owner` (Boolean) Whether to notify the account owner.
189+
- `event_owner` (Boolean) Whether to notify the event owner.
190+
- `resource_owner` (Boolean) Whether to notify the resource owner.
191+
- `tag` (String) Tag to match the resource owner from.
192+
- `value` (String) Explicit value for a notification recipient.
193+
194+
195+
196+
<a id="nestedblock--teams_delivery_settings"></a>
197+
### Nested Schema for `teams_delivery_settings`
198+
199+
Required:
200+
201+
- `template` (String) Name of the template for the notification.
202+
203+
Optional:
204+
205+
- `first_match_only` (Boolean) Only report the first match.
206+
- `recipients` (Attributes List) Recipients for the notification. (see [below for nested schema](#nestedatt--teams_delivery_settings--recipients))
207+
208+
<a id="nestedatt--teams_delivery_settings--recipients"></a>
209+
### Nested Schema for `teams_delivery_settings.recipients`
210+
211+
Optional:
212+
213+
- `account_owner` (Boolean) Whether to notify the account owner.
214+
- `event_owner` (Boolean) Whether to notify the event owner.
215+
- `resource_owner` (Boolean) Whether to notify the resource owner.
216+
- `tag` (String) Tag to match the resource owner from.
217+
- `value` (String) Explicit value for a notification recipient.
218+
219+
## Import
220+
221+
Import is supported using the following syntax:
222+
223+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
224+
225+
```shell
226+
terraform import stacklet_report_group.example $name
227+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import stacklet_report_group.example $name
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
data "stacklet_binding" "b1" {
2+
name = "binding-1"
3+
}
4+
5+
data "stacklet_binding" "b2" {
6+
name = "binding-2"
7+
}
8+
9+
resource "stacklet_report_group" "example" {
10+
name = "example"
11+
schedule = "0 12 * * *"
12+
bindings = [
13+
data.stacklet_binding.b1.uuid,
14+
data.stacklet_binding.b2.uuid,
15+
]
16+
group_by = ["account", "region"]
17+
}

0 commit comments

Comments
 (0)