@incident-io/pulumi 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +69 -0
  3. package/alertAttribute.d.ts +230 -0
  4. package/alertAttribute.d.ts.map +1 -0
  5. package/alertAttribute.js +219 -0
  6. package/alertAttribute.js.map +1 -0
  7. package/alertRoute.d.ts +511 -0
  8. package/alertRoute.d.ts.map +1 -0
  9. package/alertRoute.js +432 -0
  10. package/alertRoute.js.map +1 -0
  11. package/alertSource.d.ts +347 -0
  12. package/alertSource.d.ts.map +1 -0
  13. package/alertSource.js +241 -0
  14. package/alertSource.js.map +1 -0
  15. package/alertSourceAttribute.d.ts +180 -0
  16. package/alertSourceAttribute.d.ts.map +1 -0
  17. package/alertSourceAttribute.js +107 -0
  18. package/alertSourceAttribute.js.map +1 -0
  19. package/alertSourceAttributeBeta.d.ts +188 -0
  20. package/alertSourceAttributeBeta.d.ts.map +1 -0
  21. package/alertSourceAttributeBeta.js +115 -0
  22. package/alertSourceAttributeBeta.js.map +1 -0
  23. package/alertSourceBeta.d.ts +244 -0
  24. package/alertSourceBeta.d.ts.map +1 -0
  25. package/alertSourceBeta.js +138 -0
  26. package/alertSourceBeta.js.map +1 -0
  27. package/apiKey.d.ts +276 -0
  28. package/apiKey.d.ts.map +1 -0
  29. package/apiKey.js +211 -0
  30. package/apiKey.js.map +1 -0
  31. package/catalogEntries.d.ts +241 -0
  32. package/catalogEntries.d.ts.map +1 -0
  33. package/catalogEntries.js +242 -0
  34. package/catalogEntries.js.map +1 -0
  35. package/catalogEntry.d.ts +183 -0
  36. package/catalogEntry.d.ts.map +1 -0
  37. package/catalogEntry.js +159 -0
  38. package/catalogEntry.js.map +1 -0
  39. package/catalogType.d.ts +169 -0
  40. package/catalogType.d.ts.map +1 -0
  41. package/catalogType.js +132 -0
  42. package/catalogType.js.map +1 -0
  43. package/catalogTypeAttribute.d.ts +190 -0
  44. package/catalogTypeAttribute.d.ts.map +1 -0
  45. package/catalogTypeAttribute.js +153 -0
  46. package/catalogTypeAttribute.js.map +1 -0
  47. package/config/index.d.ts +2 -0
  48. package/config/index.d.ts.map +1 -0
  49. package/config/index.js +21 -0
  50. package/config/index.js.map +1 -0
  51. package/config/vars.d.ts +13 -0
  52. package/config/vars.d.ts.map +1 -0
  53. package/config/vars.js +49 -0
  54. package/config/vars.js.map +1 -0
  55. package/customField.d.ts +260 -0
  56. package/customField.d.ts.map +1 -0
  57. package/customField.js +226 -0
  58. package/customField.js.map +1 -0
  59. package/customFieldOption.d.ts +107 -0
  60. package/customFieldOption.d.ts.map +1 -0
  61. package/customFieldOption.js +116 -0
  62. package/customFieldOption.js.map +1 -0
  63. package/escalationPath.d.ts +257 -0
  64. package/escalationPath.d.ts.map +1 -0
  65. package/escalationPath.js +228 -0
  66. package/escalationPath.js.map +1 -0
  67. package/escalationPathBeta.d.ts +134 -0
  68. package/escalationPathBeta.d.ts.map +1 -0
  69. package/escalationPathBeta.js +105 -0
  70. package/escalationPathBeta.js.map +1 -0
  71. package/getAlertAttribute.d.ts +81 -0
  72. package/getAlertAttribute.d.ts.map +1 -0
  73. package/getAlertAttribute.js +75 -0
  74. package/getAlertAttribute.js.map +1 -0
  75. package/getAlertSource.d.ts +169 -0
  76. package/getAlertSource.d.ts.map +1 -0
  77. package/getAlertSource.js +103 -0
  78. package/getAlertSource.js.map +1 -0
  79. package/getAlertSourceAttribute.d.ts +131 -0
  80. package/getAlertSourceAttribute.d.ts.map +1 -0
  81. package/getAlertSourceAttribute.js +85 -0
  82. package/getAlertSourceAttribute.js.map +1 -0
  83. package/getAlertSourceAttributeBeta.d.ts +131 -0
  84. package/getAlertSourceAttributeBeta.d.ts.map +1 -0
  85. package/getAlertSourceAttributeBeta.js +85 -0
  86. package/getAlertSourceAttributeBeta.js.map +1 -0
  87. package/getApiKey.d.ts +167 -0
  88. package/getApiKey.d.ts.map +1 -0
  89. package/getApiKey.js +145 -0
  90. package/getApiKey.js.map +1 -0
  91. package/getCatalogEntry.d.ts +77 -0
  92. package/getCatalogEntry.d.ts.map +1 -0
  93. package/getCatalogEntry.js +59 -0
  94. package/getCatalogEntry.js.map +1 -0
  95. package/getCatalogType.d.ts +163 -0
  96. package/getCatalogType.d.ts.map +1 -0
  97. package/getCatalogType.js +135 -0
  98. package/getCatalogType.js.map +1 -0
  99. package/getCatalogTypeAttribute.d.ts +73 -0
  100. package/getCatalogTypeAttribute.d.ts.map +1 -0
  101. package/getCatalogTypeAttribute.js +53 -0
  102. package/getCatalogTypeAttribute.js.map +1 -0
  103. package/getCustomField.d.ts +67 -0
  104. package/getCustomField.d.ts.map +1 -0
  105. package/getCustomField.js +51 -0
  106. package/getCustomField.js.map +1 -0
  107. package/getCustomFieldOption.d.ts +65 -0
  108. package/getCustomFieldOption.d.ts.map +1 -0
  109. package/getCustomFieldOption.js +55 -0
  110. package/getCustomFieldOption.js.map +1 -0
  111. package/getEscalationPath.d.ts +100 -0
  112. package/getEscalationPath.d.ts.map +1 -0
  113. package/getEscalationPath.js +83 -0
  114. package/getEscalationPath.js.map +1 -0
  115. package/getEscalationPathBeta.d.ts +100 -0
  116. package/getEscalationPathBeta.d.ts.map +1 -0
  117. package/getEscalationPathBeta.js +83 -0
  118. package/getEscalationPathBeta.js.map +1 -0
  119. package/getIncidentRole.d.ts +111 -0
  120. package/getIncidentRole.d.ts.map +1 -0
  121. package/getIncidentRole.js +105 -0
  122. package/getIncidentRole.js.map +1 -0
  123. package/getIncidentTemplate.d.ts +98 -0
  124. package/getIncidentTemplate.d.ts.map +1 -0
  125. package/getIncidentTemplate.js +95 -0
  126. package/getIncidentTemplate.js.map +1 -0
  127. package/getIncidentTimestamp.d.ts +107 -0
  128. package/getIncidentTimestamp.d.ts.map +1 -0
  129. package/getIncidentTimestamp.js +109 -0
  130. package/getIncidentTimestamp.js.map +1 -0
  131. package/getIncidentType.d.ts +121 -0
  132. package/getIncidentType.d.ts.map +1 -0
  133. package/getIncidentType.js +107 -0
  134. package/getIncidentType.js.map +1 -0
  135. package/getIpAllowlist.d.ts +62 -0
  136. package/getIpAllowlist.d.ts.map +1 -0
  137. package/getIpAllowlist.js +77 -0
  138. package/getIpAllowlist.js.map +1 -0
  139. package/getPolicy.d.ts +97 -0
  140. package/getPolicy.d.ts.map +1 -0
  141. package/getPolicy.js +91 -0
  142. package/getPolicy.js.map +1 -0
  143. package/getRichText.d.ts +111 -0
  144. package/getRichText.d.ts.map +1 -0
  145. package/getRichText.js +107 -0
  146. package/getRichText.js.map +1 -0
  147. package/getSchedule.d.ts +89 -0
  148. package/getSchedule.d.ts.map +1 -0
  149. package/getSchedule.js +87 -0
  150. package/getSchedule.js.map +1 -0
  151. package/getScheduleBeta.d.ts +85 -0
  152. package/getScheduleBeta.d.ts.map +1 -0
  153. package/getScheduleBeta.js +83 -0
  154. package/getScheduleBeta.js.map +1 -0
  155. package/getScheduleReplica.d.ts +116 -0
  156. package/getScheduleReplica.d.ts.map +1 -0
  157. package/getScheduleReplica.js +79 -0
  158. package/getScheduleReplica.js.map +1 -0
  159. package/getScheduleRotation.d.ts +166 -0
  160. package/getScheduleRotation.d.ts.map +1 -0
  161. package/getScheduleRotation.js +127 -0
  162. package/getScheduleRotation.js.map +1 -0
  163. package/getScheduleRotationBeta.d.ts +122 -0
  164. package/getScheduleRotationBeta.d.ts.map +1 -0
  165. package/getScheduleRotationBeta.js +83 -0
  166. package/getScheduleRotationBeta.js.map +1 -0
  167. package/getScheduleSyncRule.d.ts +91 -0
  168. package/getScheduleSyncRule.d.ts.map +1 -0
  169. package/getScheduleSyncRule.js +79 -0
  170. package/getScheduleSyncRule.js.map +1 -0
  171. package/getScheduleSyncTarget.d.ts +100 -0
  172. package/getScheduleSyncTarget.d.ts.map +1 -0
  173. package/getScheduleSyncTarget.js +93 -0
  174. package/getScheduleSyncTarget.js.map +1 -0
  175. package/getSecret.d.ts +115 -0
  176. package/getSecret.d.ts.map +1 -0
  177. package/getSecret.js +97 -0
  178. package/getSecret.js.map +1 -0
  179. package/getSeverity.d.ts +117 -0
  180. package/getSeverity.d.ts.map +1 -0
  181. package/getSeverity.js +115 -0
  182. package/getSeverity.js.map +1 -0
  183. package/getStatus.d.ts +125 -0
  184. package/getStatus.d.ts.map +1 -0
  185. package/getStatus.js +119 -0
  186. package/getStatus.js.map +1 -0
  187. package/getUser.d.ts +52 -0
  188. package/getUser.d.ts.map +1 -0
  189. package/getUser.js +61 -0
  190. package/getUser.js.map +1 -0
  191. package/getWorkflow.d.ts +103 -0
  192. package/getWorkflow.d.ts.map +1 -0
  193. package/getWorkflow.js +77 -0
  194. package/getWorkflow.js.map +1 -0
  195. package/incidentRole.d.ts +109 -0
  196. package/incidentRole.d.ts.map +1 -0
  197. package/incidentRole.js +111 -0
  198. package/incidentRole.js.map +1 -0
  199. package/incidentTemplate.d.ts +200 -0
  200. package/incidentTemplate.d.ts.map +1 -0
  201. package/incidentTemplate.js +207 -0
  202. package/incidentTemplate.js.map +1 -0
  203. package/index.d.ts +188 -0
  204. package/index.d.ts.map +1 -0
  205. package/index.js +303 -0
  206. package/index.js.map +1 -0
  207. package/maintenanceWindow.d.ts +255 -0
  208. package/maintenanceWindow.d.ts.map +1 -0
  209. package/maintenanceWindow.js +148 -0
  210. package/maintenanceWindow.js.map +1 -0
  211. package/package.json +33 -0
  212. package/policy.d.ts +476 -0
  213. package/policy.d.ts.map +1 -0
  214. package/policy.js +387 -0
  215. package/policy.js.map +1 -0
  216. package/provider.d.ts +62 -0
  217. package/provider.d.ts.map +1 -0
  218. package/provider.js +80 -0
  219. package/provider.js.map +1 -0
  220. package/schedule.d.ts +120 -0
  221. package/schedule.d.ts.map +1 -0
  222. package/schedule.js +114 -0
  223. package/schedule.js.map +1 -0
  224. package/scheduleBeta.d.ts +104 -0
  225. package/scheduleBeta.d.ts.map +1 -0
  226. package/scheduleBeta.js +98 -0
  227. package/scheduleBeta.js.map +1 -0
  228. package/scheduleReplica.d.ts +178 -0
  229. package/scheduleReplica.d.ts.map +1 -0
  230. package/scheduleReplica.js +134 -0
  231. package/scheduleReplica.js.map +1 -0
  232. package/scheduleRotation.d.ts +287 -0
  233. package/scheduleRotation.d.ts.map +1 -0
  234. package/scheduleRotation.js +224 -0
  235. package/scheduleRotation.js.map +1 -0
  236. package/scheduleRotationBeta.d.ts +184 -0
  237. package/scheduleRotationBeta.d.ts.map +1 -0
  238. package/scheduleRotationBeta.js +121 -0
  239. package/scheduleRotationBeta.js.map +1 -0
  240. package/scheduleSyncRule.d.ts +154 -0
  241. package/scheduleSyncRule.d.ts.map +1 -0
  242. package/scheduleSyncRule.js +146 -0
  243. package/scheduleSyncRule.js.map +1 -0
  244. package/scheduleSyncTarget.d.ts +108 -0
  245. package/scheduleSyncTarget.d.ts.map +1 -0
  246. package/scheduleSyncTarget.js +106 -0
  247. package/scheduleSyncTarget.js.map +1 -0
  248. package/secret.d.ts +276 -0
  249. package/secret.d.ts.map +1 -0
  250. package/secret.js +234 -0
  251. package/secret.js.map +1 -0
  252. package/severity.d.ts +96 -0
  253. package/severity.d.ts.map +1 -0
  254. package/severity.js +102 -0
  255. package/severity.js.map +1 -0
  256. package/status.d.ts +121 -0
  257. package/status.d.ts.map +1 -0
  258. package/status.js +120 -0
  259. package/status.js.map +1 -0
  260. package/types/index.d.ts +4 -0
  261. package/types/index.d.ts.map +1 -0
  262. package/types/index.js +34 -0
  263. package/types/index.js.map +1 -0
  264. package/types/input.d.ts +23630 -0
  265. package/types/input.d.ts.map +1 -0
  266. package/types/input.js +5 -0
  267. package/types/input.js.map +1 -0
  268. package/types/output.d.ts +19726 -0
  269. package/types/output.d.ts.map +1 -0
  270. package/types/output.js +5 -0
  271. package/types/output.js.map +1 -0
  272. package/utilities.d.ts +5 -0
  273. package/utilities.d.ts.map +1 -0
  274. package/utilities.js +114 -0
  275. package/utilities.js.map +1 -0
  276. package/workflow.d.ts +736 -0
  277. package/workflow.d.ts.map +1 -0
  278. package/workflow.js +608 -0
  279. package/workflow.js.map +1 -0
package/workflow.d.ts ADDED
@@ -0,0 +1,736 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as inputs from "./types/input";
3
+ import * as outputs from "./types/output";
4
+ /**
5
+ * This resource is used to manage Workflows.
6
+ *
7
+ * We'd generally recommend building workflows in our [web dashboard](https://app.incident.io/~/workflows), and using the 'Export' flow to generate your Terraform, as it's easier to see what you've configured. You can also make changes to an existing workflow and copy the resulting Terraform without persisting it.
8
+ *
9
+ * ## Example - Assign the incident lead when an escalation is acked
10
+ *
11
+ * ```typescript
12
+ * import * as pulumi from "@pulumi/pulumi";
13
+ * import * as incident from "@incident-io/pulumi";
14
+ *
15
+ * // Teams are catalog entries, so an owning team is resolved through the catalog
16
+ * // rather than by pasting in its ID. The identifier is matched against entry
17
+ * // names, external IDs and aliases, so the team's name is enough.
18
+ * const team = incident.getCatalogType({
19
+ * name: "Team",
20
+ * });
21
+ * const platform = team.then(team => incident.getCatalogEntry({
22
+ * catalogTypeId: team.id,
23
+ * identifier: "Platform",
24
+ * }));
25
+ * // Look the incident lead role up by name, rather than pinning its ID into the
26
+ * // workflow below. The ID differs between workspaces, so a name keeps the config
27
+ * // portable.
28
+ * const incidentLead = incident.getIncidentRole({
29
+ * name: "Incident Lead",
30
+ * });
31
+ * // This is a workflow that automatically assigns the incident lead role to the user who acked an escalation.
32
+ * const autoassignIncidentLead = new incident.Workflow("autoassign_incident_lead", {
33
+ * name: "Auto-assign incident leader",
34
+ * trigger: "escalation.acked",
35
+ * expressions: [],
36
+ * conditionGroups: [{
37
+ * conditions: [{
38
+ * subject: "user",
39
+ * operation: "is_set",
40
+ * paramBindings: [],
41
+ * }],
42
+ * }],
43
+ * steps: [{
44
+ * id: "01HY0QG9WT62CEYJN8JD74MJNR",
45
+ * name: "incident.assign_role",
46
+ * paramBindings: [
47
+ * {
48
+ * value: {
49
+ * reference: "incident",
50
+ * },
51
+ * },
52
+ * {
53
+ * value: {
54
+ * literal: incidentLead.then(incidentLead => incidentLead.id),
55
+ * },
56
+ * },
57
+ * {
58
+ * value: {
59
+ * reference: "user",
60
+ * },
61
+ * },
62
+ * ],
63
+ * }],
64
+ * onceFors: ["incident"],
65
+ * owningTeamIds: [platform.then(platform => platform.id)],
66
+ * privateIncidentScope: "none",
67
+ * continueOnStepError: false,
68
+ * runsOnIncidents: "newly_created_and_active",
69
+ * runsOnIncidentModes: ["standard"],
70
+ * state: "draft",
71
+ * });
72
+ * ```
73
+ *
74
+ * ## Example - Page execs from a manual workflow, using form fields
75
+ *
76
+ * ```typescript
77
+ * import * as pulumi from "@pulumi/pulumi";
78
+ * import * as incident from "@incident-io/pulumi";
79
+ *
80
+ * // Rich text fields hold a document, not a string, so build one from markdown
81
+ * // rather than writing the JSON by hand. Variables written as {{ }} become
82
+ * // references into the workflow scope when the message is sent - a plain string
83
+ * // literal is stored as literal text and won't interpolate. The feature set must
84
+ * // match the field it's going into: a Slack message is "mrkdwn".
85
+ * const execPage = incident.getRichText({
86
+ * markdown: `**Exec page for {{ incident.name }}**
87
+ *
88
+ * {{ form.reason }}
89
+ *
90
+ * Join the incident channel: {{ incident.slack_channel }}`,
91
+ * featureSet: "mrkdwn",
92
+ * });
93
+ * // This is a manually triggered workflow that collects information from the user
94
+ * // via form fields when they run it. Each field's value is available in the
95
+ * // workflow scope as `form.<key>`, for both conditions and steps to bind
96
+ * // against - as the message below does with `form.reason`. That's the prefix the
97
+ * // dashboard shows as "Form → <title>".
98
+ * //
99
+ * // The order of the list is the order the fields appear in the form. Either
100
+ * // form_fields = [] or omitting the attribute clears any existing fields.
101
+ * //
102
+ * // A field's `id` is computed, never written: the provider correlates fields
103
+ * // across applies by `key`, so retitling a field keeps its identity (and any
104
+ * // in-flight runs), while changing its key replaces it. That's also why the key,
105
+ * // not the title, is what the scope reference uses.
106
+ * const pageExecs = new incident.Workflow("page_execs", {
107
+ * name: "Page execs",
108
+ * trigger: "manual",
109
+ * expressions: [],
110
+ * conditionGroups: [],
111
+ * steps: [{
112
+ * id: "01KG1326KD7DT1Z785SYVXXP98",
113
+ * name: "slack.send_message",
114
+ * paramBindings: [
115
+ * {
116
+ * arrayValue: [{
117
+ * reference: "form.execs",
118
+ * }],
119
+ * },
120
+ * {
121
+ * value: {
122
+ * literal: execPage.then(execPage => execPage.json),
123
+ * },
124
+ * },
125
+ * {},
126
+ * ],
127
+ * }],
128
+ * formFields: [
129
+ * {
130
+ * key: "reason",
131
+ * title: "Reason for paging",
132
+ * type: "String",
133
+ * description: "Why are we paging the execs?",
134
+ * array: false,
135
+ * required: true,
136
+ * },
137
+ * {
138
+ * key: "execs",
139
+ * title: "Who should we page?",
140
+ * type: "User",
141
+ * description: "The execs to message. Leave the on-call exec out, they're paged already.",
142
+ * array: true,
143
+ * required: true,
144
+ * },
145
+ * ],
146
+ * onceFors: ["incident"],
147
+ * privateIncidentScope: "none",
148
+ * continueOnStepError: false,
149
+ * runsOnIncidents: "newly_created_and_active",
150
+ * runsOnIncidentModes: ["standard"],
151
+ * state: "draft",
152
+ * });
153
+ * ```
154
+ *
155
+ * ## Example - Create the postmortem follow-up when an incident closes
156
+ *
157
+ * ```typescript
158
+ * import * as pulumi from "@pulumi/pulumi";
159
+ * import * as incident from "@incident-io/pulumi";
160
+ *
161
+ * // Statuses are managed by incident.io, so look one up by name rather than pasting
162
+ * // the ULID an export gives you: the ID differs between workspaces, the name is
163
+ * // what you see in the dashboard.
164
+ * const closed = incident.getStatus({
165
+ * name: "Closed",
166
+ * });
167
+ * // This workflow runs when someone moves an incident into Closed, and creates the
168
+ * // postmortem follow-up assigned to whoever closed it.
169
+ * //
170
+ * // The trigger's scope carries three references to bind against: "incident",
171
+ * // "previous-status" (the status the incident moved out of) and
172
+ * // "user-who-changed-the-status".
173
+ * //
174
+ * // Note that building this in the dashboard pre-fills a "status category is
175
+ * // Active" condition, which would stop this workflow ever running, Closed not
176
+ * // being an active category. Terraform writes conditions explicitly so there's
177
+ * // nothing to remove here, but check for that condition if you export a
178
+ * // status-driven workflow from the dashboard.
179
+ * const postmortemWhenClosed = new incident.Workflow("postmortem_when_closed", {
180
+ * name: "Create the postmortem follow-up when an incident closes",
181
+ * trigger: "incident.status-changed",
182
+ * expressions: [],
183
+ * conditionGroups: [{
184
+ * conditions: [{
185
+ * subject: "incident.status",
186
+ * operation: "one_of",
187
+ * paramBindings: [{
188
+ * arrayValue: [{
189
+ * literal: closed.then(closed => closed.id),
190
+ * }],
191
+ * }],
192
+ * }],
193
+ * }],
194
+ * steps: [{
195
+ * id: "01KT8B9QQH67GF9S6SW4A7DNEX",
196
+ * name: "incident.create_follow_ups",
197
+ * paramBindings: [
198
+ * {
199
+ * value: {
200
+ * reference: "incident",
201
+ * },
202
+ * },
203
+ * {
204
+ * arrayValue: [{
205
+ * literal: "Write the postmortem",
206
+ * }],
207
+ * },
208
+ * {
209
+ * value: {
210
+ * reference: "user-who-changed-the-status",
211
+ * },
212
+ * },
213
+ * {},
214
+ * {},
215
+ * {},
216
+ * ],
217
+ * }],
218
+ * onceFors: ["incident"],
219
+ * privateIncidentScope: "none",
220
+ * continueOnStepError: false,
221
+ * runsOnIncidents: "newly_created_and_active",
222
+ * runsOnIncidentModes: ["standard"],
223
+ * state: "draft",
224
+ * });
225
+ * ```
226
+ *
227
+ * ## Example - Invite the security responders to an incident
228
+ *
229
+ * ```typescript
230
+ * import * as pulumi from "@pulumi/pulumi";
231
+ * import * as incident from "@incident-io/pulumi";
232
+ *
233
+ * // Users have a data source, so a config doesn't need the ULIDs an export writes
234
+ * // for them: look people up by the email address they use with incident.io.
235
+ * const securityLead = incident.getUser({
236
+ * email: "security-lead@example.com",
237
+ * });
238
+ * // Slack user groups reach the engine through the catalog, as entries of the
239
+ * // managed "Slack User Group" type. The identifier matches an entry's name,
240
+ * // external ID or aliases, so the group's handle is enough.
241
+ * const slackUserGroup = incident.getCatalogType({
242
+ * name: "Slack User Group",
243
+ * });
244
+ * const securityResponders = slackUserGroup.then(slackUserGroup => incident.getCatalogEntry({
245
+ * catalogTypeId: slackUserGroup.id,
246
+ * identifier: "security-responders",
247
+ * }));
248
+ * // This workflow pulls the security responders into an incident's channel as soon
249
+ * // as the incident becomes active.
250
+ * //
251
+ * // Four steps sound alike but do different things, so pick deliberately:
252
+ * //
253
+ * // slack.invite_user invites users and Slack user groups to
254
+ * // the incident's channel (this one)
255
+ * // incident.add_member grants access to a private incident, and
256
+ * // does nothing on a public one
257
+ * // incident.assign_role gives someone an incident role, such as
258
+ * // Incident Lead
259
+ * // incident.subscribe_user_to_incident subscribes someone to updates without
260
+ * // making them a participant
261
+ * //
262
+ * // Narrow this with conditions on whatever marks the incidents you care about -
263
+ * // a custom field, the incident's type, or its severity.
264
+ * const inviteSecurityResponders = new incident.Workflow("invite_security_responders", {
265
+ * name: "Invite security responders",
266
+ * trigger: "incident.updated",
267
+ * expressions: [],
268
+ * conditionGroups: [{
269
+ * conditions: [{
270
+ * subject: "incident.status.category",
271
+ * operation: "one_of",
272
+ * paramBindings: [{
273
+ * arrayValue: [{
274
+ * literal: "active",
275
+ * }],
276
+ * }],
277
+ * }],
278
+ * }],
279
+ * steps: [{
280
+ * id: "01KFD47KKJS93YXR3W53MQSFVC",
281
+ * name: "slack.invite_user",
282
+ * paramBindings: [
283
+ * {
284
+ * value: {
285
+ * reference: "incident",
286
+ * },
287
+ * },
288
+ * {
289
+ * arrayValue: [{
290
+ * literal: securityLead.then(securityLead => securityLead.id),
291
+ * }],
292
+ * },
293
+ * {
294
+ * arrayValue: [{
295
+ * literal: securityResponders.then(securityResponders => securityResponders.id),
296
+ * }],
297
+ * },
298
+ * ],
299
+ * }],
300
+ * onceFors: ["incident"],
301
+ * privateIncidentScope: "none",
302
+ * continueOnStepError: false,
303
+ * runsOnIncidents: "newly_created_and_active",
304
+ * runsOnIncidentModes: ["standard"],
305
+ * state: "draft",
306
+ * });
307
+ * ```
308
+ *
309
+ * ## Example - Share incident updates with leadership
310
+ *
311
+ * ```typescript
312
+ * import * as pulumi from "@pulumi/pulumi";
313
+ * import * as incident from "@incident-io/pulumi";
314
+ *
315
+ * // A message body is a rich text document, so build it from markdown here rather
316
+ * // than pasting the JSON an export produces. Anything the feature set can't hold
317
+ * // is dropped and listed in dropped_content, which you can output to see what
318
+ * // went missing.
319
+ * const leadershipUpdate = incident.getRichText({
320
+ * markdown: `**{{ incident.name }}** — update from {{ update.author }}
321
+ *
322
+ * {{ update.message }}
323
+ *
324
+ * Now at {{ update.to_status }}, severity {{ update.to_severity }}. Follow along in {{ incident.slack_channel }}.
325
+ * `,
326
+ * featureSet: "mrkdwn",
327
+ * });
328
+ * // This workflow mirrors every incident update into a leadership channel.
329
+ * //
330
+ * // Three Slack steps send messages, and they take different first parameters:
331
+ * //
332
+ * // slack.post_message posts to a channel, which is where this one goes
333
+ * // slack.send_message sends a DM to users
334
+ * // slack.reply_in_thread replies to a message already in the scope
335
+ * //
336
+ * // On Microsoft Teams the equivalent is ms_teams.post_message, whose channel
337
+ * // parameter takes a MicrosoftTeamsChatChannel and defaults to
338
+ * // `incident.ms_teams_channel`. Only the steps for your workspace's primary
339
+ * // comms platform are available, so a config written for one won't apply to the
340
+ * // other.
341
+ * const shareUpdatesWithLeadership = new incident.Workflow("share_updates_with_leadership", {
342
+ * name: "Share incident updates with leadership",
343
+ * trigger: "incident.update_shared",
344
+ * expressions: [],
345
+ * conditionGroups: [],
346
+ * steps: [{
347
+ * id: "01K5TSNDBF7KBZY9AFDKYXJM3M",
348
+ * name: "slack.post_message",
349
+ * paramBindings: [
350
+ * {
351
+ * value: {
352
+ * literal: "C02A1FSNEKC",
353
+ * },
354
+ * },
355
+ * {
356
+ * value: {
357
+ * literal: leadershipUpdate.then(leadershipUpdate => leadershipUpdate.json),
358
+ * },
359
+ * },
360
+ * {},
361
+ * {
362
+ * value: {
363
+ * literal: "Europe/London",
364
+ * },
365
+ * },
366
+ * ],
367
+ * }],
368
+ * onceFors: [],
369
+ * privateIncidentScope: "none",
370
+ * continueOnStepError: false,
371
+ * runsOnIncidents: "newly_created_and_active",
372
+ * runsOnIncidentModes: ["standard"],
373
+ * state: "draft",
374
+ * });
375
+ * ```
376
+ *
377
+ * ## Example - Subscribe CSMs to customer-facing incidents
378
+ *
379
+ * ```typescript
380
+ * import * as pulumi from "@pulumi/pulumi";
381
+ * import * as incident from "@incident-io/pulumi";
382
+ *
383
+ * // Custom fields and their options both have data sources, so a condition on one
384
+ * // needs no ULIDs: look the field up by name, and each option by its value.
385
+ * const affectedCustomers = incident.getCustomField({
386
+ * name: "Affected customers",
387
+ * });
388
+ * const allCustomers = affectedCustomers.then(affectedCustomers => incident.getCustomFieldOption({
389
+ * customFieldId: affectedCustomers.id,
390
+ * value: "All customers",
391
+ * }));
392
+ * const csmLead = incident.getUser({
393
+ * email: "csm-lead@example.com",
394
+ * });
395
+ * const csmDeputy = incident.getUser({
396
+ * email: "csm-deputy@example.com",
397
+ * });
398
+ * // This is the workflow we run ourselves: subscribe the CSM team to every
399
+ * // Critical incident, and to Major incidents that affect all customers.
400
+ * //
401
+ * // It's the clearest example of how condition groups combine. Conditions within
402
+ * // a group are ANDed, and the groups are ORed with each other, so this reads as:
403
+ * //
404
+ * // severity is Critical
405
+ * // OR (severity is Major AND affected customers is All customers)
406
+ * //
407
+ * // Two conditions that must both hold go in one group. Two alternatives, as
408
+ * // here, need a group each - putting all three conditions in a single group
409
+ * // would subscribe nobody, since no incident is both Critical and Major.
410
+ * const subscribeCsms = new incident.Workflow("subscribe_csms", {
411
+ * name: "Subscribe CSMs to customer-facing incidents",
412
+ * trigger: "incident.updated",
413
+ * expressions: [],
414
+ * conditionGroups: [
415
+ * {
416
+ * conditions: [{
417
+ * subject: "incident.severity",
418
+ * operation: "one_of",
419
+ * paramBindings: [{
420
+ * arrayValue: [{
421
+ * literal: "01K675152G91VK4S8YYT7NKPAE",
422
+ * }],
423
+ * }],
424
+ * }],
425
+ * },
426
+ * {
427
+ * conditions: [
428
+ * {
429
+ * subject: "incident.severity",
430
+ * operation: "one_of",
431
+ * paramBindings: [{
432
+ * arrayValue: [{
433
+ * literal: "01KCZFEB7DPVCQQM262JTKN5RH",
434
+ * }],
435
+ * }],
436
+ * },
437
+ * {
438
+ * subject: affectedCustomers.then(affectedCustomers => `incident.custom_field["${affectedCustomers.id}"]`),
439
+ * operation: "one_of",
440
+ * paramBindings: [{
441
+ * arrayValue: [{
442
+ * literal: allCustomers.then(allCustomers => allCustomers.id),
443
+ * }],
444
+ * }],
445
+ * },
446
+ * ],
447
+ * },
448
+ * ],
449
+ * steps: [{
450
+ * id: "01KDEMWQCS30P3GHAVNG9VGKWS",
451
+ * name: "incident.subscribe_user_to_incident",
452
+ * paramBindings: [
453
+ * {
454
+ * value: {
455
+ * reference: "incident",
456
+ * },
457
+ * },
458
+ * {
459
+ * arrayValue: [
460
+ * {
461
+ * literal: csmLead.then(csmLead => csmLead.id),
462
+ * },
463
+ * {
464
+ * literal: csmDeputy.then(csmDeputy => csmDeputy.id),
465
+ * },
466
+ * ],
467
+ * },
468
+ * ],
469
+ * }],
470
+ * onceFors: ["incident"],
471
+ * privateIncidentScope: "none",
472
+ * continueOnStepError: false,
473
+ * runsOnIncidents: "newly_created_and_active",
474
+ * runsOnIncidentModes: ["standard"],
475
+ * state: "draft",
476
+ * });
477
+ * ```
478
+ */
479
+ export declare class Workflow extends pulumi.CustomResource {
480
+ /**
481
+ * Get an existing Workflow resource's state with the given name, ID, and optional extra
482
+ * properties used to qualify the lookup.
483
+ *
484
+ * @param name The _unique_ name of the resulting resource.
485
+ * @param id The _unique_ provider ID of the resource to lookup.
486
+ * @param state Any extra arguments used during the lookup.
487
+ * @param opts Optional settings to control the behavior of the CustomResource.
488
+ */
489
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: WorkflowState, opts?: pulumi.CustomResourceOptions): Workflow;
490
+ /**
491
+ * Returns true if the given object is an instance of Workflow. This is designed to work even
492
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
493
+ */
494
+ static isInstance(obj: any): obj is Workflow;
495
+ /**
496
+ * Groups of prerequisite conditions. All conditions in at least one group must be satisfied
497
+ */
498
+ readonly conditionGroups: pulumi.Output<outputs.WorkflowConditionGroup[]>;
499
+ /**
500
+ * Whether to continue executing the workflow if a step fails
501
+ */
502
+ readonly continueOnStepError: pulumi.Output<boolean>;
503
+ /**
504
+ * Configuration controlling workflow delay behaviour
505
+ */
506
+ readonly delay: pulumi.Output<outputs.WorkflowDelay | undefined>;
507
+ /**
508
+ * The expressions to be prepared for use by steps and conditions
509
+ */
510
+ readonly expressions: pulumi.Output<outputs.WorkflowExpression[]>;
511
+ /**
512
+ * Folder to display the workflow in
513
+ */
514
+ readonly folder: pulumi.Output<string | undefined>;
515
+ /**
516
+ * User-configured form fields available in the workflow scope (manual triggers only)
517
+ */
518
+ readonly formFields: pulumi.Output<outputs.WorkflowFormField[] | undefined>;
519
+ /**
520
+ * Whether to include private escalations
521
+ */
522
+ readonly includePrivateEscalations: pulumi.Output<boolean>;
523
+ /**
524
+ * DEPRECATED: use `privateIncidentScope` instead. `true` when the workflow runs on private incidents (a `privateIncidentScope` of `all` or `owningTeams`), `false` when the scope is `none`.
525
+ *
526
+ * @deprecated Use `privateIncidentScope` instead. When both are set they must agree (include_private_incidents is true for the all and owningTeams scopes, false for none).
527
+ */
528
+ readonly includePrivateIncidents: pulumi.Output<boolean>;
529
+ /**
530
+ * Name provided by the user when creating the workflow
531
+ */
532
+ readonly name: pulumi.Output<string>;
533
+ /**
534
+ * This workflow will run 'once for' a list of references
535
+ */
536
+ readonly onceFors: pulumi.Output<string[]>;
537
+ /**
538
+ * IDs of the teams that own this workflow
539
+ */
540
+ readonly owningTeamIds: pulumi.Output<string[] | undefined>;
541
+ /**
542
+ * Which private incidents this workflow acts on: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are: `all`, `owningTeams`, `none`.
543
+ */
544
+ readonly privateIncidentScope: pulumi.Output<string>;
545
+ /**
546
+ * Which incident modes should this workflow run on? By default, workflows only run on standard incidents, but can also be configured to run on test and retrospective incidents. Possible values are: `standard`, `test`, `retrospective`.
547
+ */
548
+ readonly runsOnIncidentModes: pulumi.Output<string[]>;
549
+ /**
550
+ * Which incidents should the workflow be applied to? Possible values are: `newlyCreated`, `newlyCreatedAndActive`.
551
+ */
552
+ readonly runsOnIncidents: pulumi.Output<string>;
553
+ /**
554
+ * The shortform used to trigger this workflow (only applicable for manual triggers)
555
+ */
556
+ readonly shortform: pulumi.Output<string | undefined>;
557
+ /**
558
+ * What state this workflow is in. Possible values are: `active`, `disabled`, `draft`, `error`.
559
+ */
560
+ readonly state: pulumi.Output<string>;
561
+ /**
562
+ * Steps that are executed as part of the workflow
563
+ */
564
+ readonly steps: pulumi.Output<outputs.WorkflowStep[]>;
565
+ /**
566
+ * Unique name of the trigger
567
+ */
568
+ readonly trigger: pulumi.Output<string>;
569
+ /**
570
+ * Create a Workflow resource with the given unique name, arguments, and options.
571
+ *
572
+ * @param name The _unique_ name of the resource.
573
+ * @param args The arguments to use to populate this resource's properties.
574
+ * @param opts A bag of options that control this resource's behavior.
575
+ */
576
+ constructor(name: string, args: WorkflowArgs, opts?: pulumi.CustomResourceOptions);
577
+ }
578
+ /**
579
+ * Input properties used for looking up and filtering Workflow resources.
580
+ */
581
+ export interface WorkflowState {
582
+ /**
583
+ * Groups of prerequisite conditions. All conditions in at least one group must be satisfied
584
+ */
585
+ conditionGroups?: pulumi.Input<pulumi.Input<inputs.WorkflowConditionGroup>[] | undefined>;
586
+ /**
587
+ * Whether to continue executing the workflow if a step fails
588
+ */
589
+ continueOnStepError?: pulumi.Input<boolean | undefined>;
590
+ /**
591
+ * Configuration controlling workflow delay behaviour
592
+ */
593
+ delay?: pulumi.Input<inputs.WorkflowDelay | undefined>;
594
+ /**
595
+ * The expressions to be prepared for use by steps and conditions
596
+ */
597
+ expressions?: pulumi.Input<pulumi.Input<inputs.WorkflowExpression>[] | undefined>;
598
+ /**
599
+ * Folder to display the workflow in
600
+ */
601
+ folder?: pulumi.Input<string | undefined>;
602
+ /**
603
+ * User-configured form fields available in the workflow scope (manual triggers only)
604
+ */
605
+ formFields?: pulumi.Input<pulumi.Input<inputs.WorkflowFormField>[] | undefined>;
606
+ /**
607
+ * Whether to include private escalations
608
+ */
609
+ includePrivateEscalations?: pulumi.Input<boolean | undefined>;
610
+ /**
611
+ * DEPRECATED: use `privateIncidentScope` instead. `true` when the workflow runs on private incidents (a `privateIncidentScope` of `all` or `owningTeams`), `false` when the scope is `none`.
612
+ *
613
+ * @deprecated Use `privateIncidentScope` instead. When both are set they must agree (include_private_incidents is true for the all and owningTeams scopes, false for none).
614
+ */
615
+ includePrivateIncidents?: pulumi.Input<boolean | undefined>;
616
+ /**
617
+ * Name provided by the user when creating the workflow
618
+ */
619
+ name?: pulumi.Input<string | undefined>;
620
+ /**
621
+ * This workflow will run 'once for' a list of references
622
+ */
623
+ onceFors?: pulumi.Input<pulumi.Input<string>[] | undefined>;
624
+ /**
625
+ * IDs of the teams that own this workflow
626
+ */
627
+ owningTeamIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
628
+ /**
629
+ * Which private incidents this workflow acts on: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are: `all`, `owningTeams`, `none`.
630
+ */
631
+ privateIncidentScope?: pulumi.Input<string | undefined>;
632
+ /**
633
+ * Which incident modes should this workflow run on? By default, workflows only run on standard incidents, but can also be configured to run on test and retrospective incidents. Possible values are: `standard`, `test`, `retrospective`.
634
+ */
635
+ runsOnIncidentModes?: pulumi.Input<pulumi.Input<string>[] | undefined>;
636
+ /**
637
+ * Which incidents should the workflow be applied to? Possible values are: `newlyCreated`, `newlyCreatedAndActive`.
638
+ */
639
+ runsOnIncidents?: pulumi.Input<string | undefined>;
640
+ /**
641
+ * The shortform used to trigger this workflow (only applicable for manual triggers)
642
+ */
643
+ shortform?: pulumi.Input<string | undefined>;
644
+ /**
645
+ * What state this workflow is in. Possible values are: `active`, `disabled`, `draft`, `error`.
646
+ */
647
+ state?: pulumi.Input<string | undefined>;
648
+ /**
649
+ * Steps that are executed as part of the workflow
650
+ */
651
+ steps?: pulumi.Input<pulumi.Input<inputs.WorkflowStep>[] | undefined>;
652
+ /**
653
+ * Unique name of the trigger
654
+ */
655
+ trigger?: pulumi.Input<string | undefined>;
656
+ }
657
+ /**
658
+ * The set of arguments for constructing a Workflow resource.
659
+ */
660
+ export interface WorkflowArgs {
661
+ /**
662
+ * Groups of prerequisite conditions. All conditions in at least one group must be satisfied
663
+ */
664
+ conditionGroups: pulumi.Input<pulumi.Input<inputs.WorkflowConditionGroup>[]>;
665
+ /**
666
+ * Whether to continue executing the workflow if a step fails
667
+ */
668
+ continueOnStepError: pulumi.Input<boolean>;
669
+ /**
670
+ * Configuration controlling workflow delay behaviour
671
+ */
672
+ delay?: pulumi.Input<inputs.WorkflowDelay | undefined>;
673
+ /**
674
+ * The expressions to be prepared for use by steps and conditions
675
+ */
676
+ expressions: pulumi.Input<pulumi.Input<inputs.WorkflowExpression>[]>;
677
+ /**
678
+ * Folder to display the workflow in
679
+ */
680
+ folder?: pulumi.Input<string | undefined>;
681
+ /**
682
+ * User-configured form fields available in the workflow scope (manual triggers only)
683
+ */
684
+ formFields?: pulumi.Input<pulumi.Input<inputs.WorkflowFormField>[] | undefined>;
685
+ /**
686
+ * Whether to include private escalations
687
+ */
688
+ includePrivateEscalations?: pulumi.Input<boolean | undefined>;
689
+ /**
690
+ * DEPRECATED: use `privateIncidentScope` instead. `true` when the workflow runs on private incidents (a `privateIncidentScope` of `all` or `owningTeams`), `false` when the scope is `none`.
691
+ *
692
+ * @deprecated Use `privateIncidentScope` instead. When both are set they must agree (include_private_incidents is true for the all and owningTeams scopes, false for none).
693
+ */
694
+ includePrivateIncidents?: pulumi.Input<boolean | undefined>;
695
+ /**
696
+ * Name provided by the user when creating the workflow
697
+ */
698
+ name?: pulumi.Input<string | undefined>;
699
+ /**
700
+ * This workflow will run 'once for' a list of references
701
+ */
702
+ onceFors: pulumi.Input<pulumi.Input<string>[]>;
703
+ /**
704
+ * IDs of the teams that own this workflow
705
+ */
706
+ owningTeamIds?: pulumi.Input<pulumi.Input<string>[] | undefined>;
707
+ /**
708
+ * Which private incidents this workflow acts on: every private incident (all), those an owning team can see (owning_teams), or none. Possible values are: `all`, `owningTeams`, `none`.
709
+ */
710
+ privateIncidentScope?: pulumi.Input<string | undefined>;
711
+ /**
712
+ * Which incident modes should this workflow run on? By default, workflows only run on standard incidents, but can also be configured to run on test and retrospective incidents. Possible values are: `standard`, `test`, `retrospective`.
713
+ */
714
+ runsOnIncidentModes: pulumi.Input<pulumi.Input<string>[]>;
715
+ /**
716
+ * Which incidents should the workflow be applied to? Possible values are: `newlyCreated`, `newlyCreatedAndActive`.
717
+ */
718
+ runsOnIncidents: pulumi.Input<string>;
719
+ /**
720
+ * The shortform used to trigger this workflow (only applicable for manual triggers)
721
+ */
722
+ shortform?: pulumi.Input<string | undefined>;
723
+ /**
724
+ * What state this workflow is in. Possible values are: `active`, `disabled`, `draft`, `error`.
725
+ */
726
+ state: pulumi.Input<string>;
727
+ /**
728
+ * Steps that are executed as part of the workflow
729
+ */
730
+ steps: pulumi.Input<pulumi.Input<inputs.WorkflowStep>[]>;
731
+ /**
732
+ * Unique name of the trigger
733
+ */
734
+ trigger: pulumi.Input<string>;
735
+ }
736
+ //# sourceMappingURL=workflow.d.ts.map