@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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2026 incident.io
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # Pulumi provider for incident.io
2
+
3
+ Manage incident.io configuration as code from a Pulumi program, in TypeScript, Python or Go.
4
+
5
+ Generated from [`terraform-provider-incident`](https://github.com/incident-io/terraform-provider-incident), so anything you can manage with Terraform you can manage here.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @incident-io/pulumi
11
+ pip install pulumi-incident
12
+ go get github.com/incident-io/pulumi-incident/sdk/go/incident
13
+ ```
14
+
15
+ ## Configure
16
+
17
+ Create an API key in [Settings → API keys](https://app.incident.io/settings/api-keys), then either:
18
+
19
+ ```bash
20
+ pulumi config set --secret incident:apiKey inc_...
21
+ # or
22
+ export INCIDENT_API_KEY=inc_...
23
+ ```
24
+
25
+ On a dedicated or self-hosted deployment, also set `incident:endpoint`.
26
+
27
+ ## Example
28
+
29
+ ```typescript
30
+ import * as incident from "@incident-io/pulumi";
31
+
32
+ const trivial = new incident.Severity("trivial", {
33
+ name: "Trivial",
34
+ description: "Issues causing no impact.",
35
+ rank: 1,
36
+ });
37
+ ```
38
+
39
+ Per-resource reference and examples in all three languages are on the [Pulumi Registry page](https://www.pulumi.com/registry/packages/incident/).
40
+
41
+ ## What you can manage
42
+
43
+ Escalation paths, schedules and schedule sync rules. Alert sources, routes and attributes. Catalog types, attributes and entries. Severities, statuses, incident roles, custom fields. Workflows, maintenance windows, policies, secrets and API keys.
44
+
45
+ Resources with `Beta` in the name track features still changing in the product, and their inputs may change in a minor release.
46
+
47
+ ## Import existing configuration
48
+
49
+ Every resource supports `pulumi import`:
50
+
51
+ ```bash
52
+ pulumi import incident:index/severity:Severity trivial 01ABCDEF...
53
+ ```
54
+
55
+ Importing claims the resource as managed by code, which stops it being edited in the dashboard. That claim is a write to your account, so set `markImportedResourcesAsManaged` to `false` if you would rather imports left it untouched.
56
+
57
+ ## Moving from the Terraform bridge
58
+
59
+ If you use `pulumi package add terraform-provider incident-io/incident` today, this package replaces it. Resource names and properties are the same, so your program does not change. Remove the `packages` entry from `Pulumi.yaml`, delete the generated SDK, and install the published package.
60
+
61
+ ## Help
62
+
63
+ - [Registry docs](https://www.pulumi.com/registry/packages/incident/) for per-resource reference
64
+ - [API docs](https://api-docs.incident.io/) for what the underlying API supports
65
+ - [Issues](https://github.com/incident-io/pulumi-incident/issues) here for packaging problems, or [terraform-provider-incident](https://github.com/incident-io/terraform-provider-incident/issues) for resource behaviour, since that is where resources are implemented
66
+
67
+ [CONTRIBUTING.md](./CONTRIBUTING.md) covers building and regenerating the SDKs.
68
+
69
+ MIT licensed. See [LICENSE](./LICENSE).
@@ -0,0 +1,230 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * View and manage alert attributes.
4
+ *
5
+ * Alert attributes are used to parse structured data from alerts coming in via alert sources.
6
+ *
7
+ * ## An attribute is account-wide; what fills it in is per source
8
+ *
9
+ * An alert attribute is the column, not the rule that populates it. It belongs to your whole
10
+ * incident.io organization: its `name` has to be unique across the account, and every alert
11
+ * source draws on the same set of attributes. That is deliberate — one attribute means the same
12
+ * thing whichever source fired the alert, so an alert route spanning several sources can match
13
+ * on it.
14
+ *
15
+ * What varies per source is the *binding*: the rule parsing a value for this attribute out of an
16
+ * incoming event. A source binds a given attribute at most once, and two sources can fill the
17
+ * same attribute from completely different parts of their payloads. Write each binding as an
18
+ * `incident.AlertSourceAttribute` resource, naming the attribute and the
19
+ * `incident.AlertSource` that fills it in.
20
+ *
21
+ * So a `GCP service` attribute is declared once, then bound separately by each source that sets it.
22
+ *
23
+ * ## Declaring one attribute from several workspaces
24
+ *
25
+ * If your Terraform is split across workspaces — one per environment, say — only one of them
26
+ * should declare an attribute as a resource. The others should read it with the
27
+ * `incident.AlertAttribute` data source, which looks an attribute up by name:
28
+ *
29
+ * ```typescript
30
+ * import * as pulumi from "@pulumi/pulumi";
31
+ * import * as incident from "@incident-io/pulumi";
32
+ *
33
+ * const gcpService = incident.getAlertAttribute({
34
+ * name: "GCP service",
35
+ * });
36
+ * ```
37
+ *
38
+ * Declaring the same `name` in two workspaces plans cleanly in both, then fails when the second
39
+ * applies: the attribute it means to create already exists. To bring an attribute that already
40
+ * exists under a workspace's management instead, `import` it.
41
+ *
42
+ * Per-environment differences belong on the binding rather than the attribute, so both
43
+ * environments share one attribute and each parses it from its own source.
44
+ *
45
+ * ## Reserved names
46
+ *
47
+ * `Title`, `Description` and `Priority` collide with properties every alert already has, and are
48
+ * rejected regardless of casing. `Priority` does exist as an attribute you can bind and filter on,
49
+ * but it is read-only through the API: read it with the data source rather than declaring it.
50
+ *
51
+ * ## Example Usage
52
+ *
53
+ * ```typescript
54
+ * import * as pulumi from "@pulumi/pulumi";
55
+ * import * as incident from "@incident-io/pulumi";
56
+ *
57
+ * // Create an alert attribute that points at a single Github user in the catalog.
58
+ * //
59
+ * // Take the engine type from the catalog type itself rather than writing it out: a type one
60
+ * // of our integrations owns is referenced by its registry name, and a type you manage by its
61
+ * // ID, so the two don't have the same shape.
62
+ * const githubUser = incident.getCatalogType({
63
+ * typeName: "GithubUser",
64
+ * });
65
+ * const githubUserAlertAttribute = new incident.AlertAttribute("github_user", {
66
+ * name: "Github user",
67
+ * type: githubUser.then(githubUser => githubUser.attributeType),
68
+ * array: false,
69
+ * required: true,
70
+ * });
71
+ * // Create an optional alert attribute for severity information
72
+ * const severity = new incident.AlertAttribute("severity", {
73
+ * name: "Severity",
74
+ * type: "String",
75
+ * array: false,
76
+ * required: false,
77
+ * emoji: "warning",
78
+ * });
79
+ * // An attribute is account-wide, so declare it once. What differs between environments is the
80
+ * // binding that fills it in, which belongs to an alert source.
81
+ * const gcpService = new incident.AlertAttribute("gcp_service", {
82
+ * name: "GCP service",
83
+ * type: "String",
84
+ * array: false,
85
+ * });
86
+ * // Staging and production each parse the same attribute out of their own source, so both
87
+ * // environments' alerts are labelled with one attribute that routes can match on.
88
+ * const gcpServiceStaging = new incident.AlertSourceAttribute("gcp_service_staging", {
89
+ * expression: {
90
+ * operations: [{
91
+ * parse: {
92
+ * "function": "$.resource.labels.service_name",
93
+ * as: "String",
94
+ * },
95
+ * }],
96
+ * startFrom: "payload",
97
+ * },
98
+ * alertSourceId: gcpStaging.id,
99
+ * alertAttributeId: gcpService.id,
100
+ * });
101
+ * const gcpServiceProduction = new incident.AlertSourceAttribute("gcp_service_production", {
102
+ * expression: {
103
+ * operations: [{
104
+ * parse: {
105
+ * "function": "$.resource.labels.service_name",
106
+ * as: "String",
107
+ * },
108
+ * }],
109
+ * startFrom: "payload",
110
+ * },
111
+ * alertSourceId: gcpProduction.id,
112
+ * alertAttributeId: gcpService.id,
113
+ * });
114
+ * // Where a source lives in a different workspace to the attribute it binds, read the attribute
115
+ * // by name rather than declaring it again. Two workspaces declaring the same name will both plan
116
+ * // cleanly, and then the second one to apply will fail.
117
+ * const existingGcpService = incident.getAlertAttribute({
118
+ * name: "GCP service",
119
+ * });
120
+ * const gcpServiceOtherWorkspace = new incident.AlertSourceAttribute("gcp_service_other_workspace", {
121
+ * expression: {
122
+ * operations: [{
123
+ * parse: {
124
+ * "function": "$.resource.labels.service_name",
125
+ * as: "String",
126
+ * },
127
+ * }],
128
+ * startFrom: "payload",
129
+ * },
130
+ * alertSourceId: gcpOther.id,
131
+ * alertAttributeId: existingGcpService.then(existingGcpService => existingGcpService.id),
132
+ * });
133
+ * ```
134
+ */
135
+ export declare class AlertAttribute extends pulumi.CustomResource {
136
+ /**
137
+ * Get an existing AlertAttribute resource's state with the given name, ID, and optional extra
138
+ * properties used to qualify the lookup.
139
+ *
140
+ * @param name The _unique_ name of the resulting resource.
141
+ * @param id The _unique_ provider ID of the resource to lookup.
142
+ * @param state Any extra arguments used during the lookup.
143
+ * @param opts Optional settings to control the behavior of the CustomResource.
144
+ */
145
+ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AlertAttributeState, opts?: pulumi.CustomResourceOptions): AlertAttribute;
146
+ /**
147
+ * Returns true if the given object is an instance of AlertAttribute. This is designed to work even
148
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
149
+ */
150
+ static isInstance(obj: any): obj is AlertAttribute;
151
+ /**
152
+ * Whether this attribute is an array
153
+ */
154
+ readonly array: pulumi.Output<boolean>;
155
+ /**
156
+ * The emoji to display alongside this attribute in chat messages, stored without colons
157
+ */
158
+ readonly emoji: pulumi.Output<string | undefined>;
159
+ /**
160
+ * Unique name of this attribute
161
+ */
162
+ readonly name: pulumi.Output<string>;
163
+ /**
164
+ * Whether this attribute is required. If this field is not set, the existing setting will be preserved.
165
+ */
166
+ readonly required: pulumi.Output<boolean>;
167
+ /**
168
+ * Engine resource name for this attribute
169
+ */
170
+ readonly type: pulumi.Output<string>;
171
+ /**
172
+ * Create a AlertAttribute resource with the given unique name, arguments, and options.
173
+ *
174
+ * @param name The _unique_ name of the resource.
175
+ * @param args The arguments to use to populate this resource's properties.
176
+ * @param opts A bag of options that control this resource's behavior.
177
+ */
178
+ constructor(name: string, args: AlertAttributeArgs, opts?: pulumi.CustomResourceOptions);
179
+ }
180
+ /**
181
+ * Input properties used for looking up and filtering AlertAttribute resources.
182
+ */
183
+ export interface AlertAttributeState {
184
+ /**
185
+ * Whether this attribute is an array
186
+ */
187
+ array?: pulumi.Input<boolean | undefined>;
188
+ /**
189
+ * The emoji to display alongside this attribute in chat messages, stored without colons
190
+ */
191
+ emoji?: pulumi.Input<string | undefined>;
192
+ /**
193
+ * Unique name of this attribute
194
+ */
195
+ name?: pulumi.Input<string | undefined>;
196
+ /**
197
+ * Whether this attribute is required. If this field is not set, the existing setting will be preserved.
198
+ */
199
+ required?: pulumi.Input<boolean | undefined>;
200
+ /**
201
+ * Engine resource name for this attribute
202
+ */
203
+ type?: pulumi.Input<string | undefined>;
204
+ }
205
+ /**
206
+ * The set of arguments for constructing a AlertAttribute resource.
207
+ */
208
+ export interface AlertAttributeArgs {
209
+ /**
210
+ * Whether this attribute is an array
211
+ */
212
+ array: pulumi.Input<boolean>;
213
+ /**
214
+ * The emoji to display alongside this attribute in chat messages, stored without colons
215
+ */
216
+ emoji?: pulumi.Input<string | undefined>;
217
+ /**
218
+ * Unique name of this attribute
219
+ */
220
+ name?: pulumi.Input<string | undefined>;
221
+ /**
222
+ * Whether this attribute is required. If this field is not set, the existing setting will be preserved.
223
+ */
224
+ required?: pulumi.Input<boolean | undefined>;
225
+ /**
226
+ * Engine resource name for this attribute
227
+ */
228
+ type: pulumi.Input<string>;
229
+ }
230
+ //# sourceMappingURL=alertAttribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alertAttribute.d.ts","sourceRoot":"","sources":["../alertAttribute.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAC7C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || function (mod) {
21
+ if (mod && mod.__esModule) return mod;
22
+ var result = {};
23
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
+ __setModuleDefault(result, mod);
25
+ return result;
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.AlertAttribute = void 0;
29
+ const pulumi = __importStar(require("@pulumi/pulumi"));
30
+ const utilities = __importStar(require("./utilities"));
31
+ /**
32
+ * View and manage alert attributes.
33
+ *
34
+ * Alert attributes are used to parse structured data from alerts coming in via alert sources.
35
+ *
36
+ * ## An attribute is account-wide; what fills it in is per source
37
+ *
38
+ * An alert attribute is the column, not the rule that populates it. It belongs to your whole
39
+ * incident.io organization: its `name` has to be unique across the account, and every alert
40
+ * source draws on the same set of attributes. That is deliberate — one attribute means the same
41
+ * thing whichever source fired the alert, so an alert route spanning several sources can match
42
+ * on it.
43
+ *
44
+ * What varies per source is the *binding*: the rule parsing a value for this attribute out of an
45
+ * incoming event. A source binds a given attribute at most once, and two sources can fill the
46
+ * same attribute from completely different parts of their payloads. Write each binding as an
47
+ * `incident.AlertSourceAttribute` resource, naming the attribute and the
48
+ * `incident.AlertSource` that fills it in.
49
+ *
50
+ * So a `GCP service` attribute is declared once, then bound separately by each source that sets it.
51
+ *
52
+ * ## Declaring one attribute from several workspaces
53
+ *
54
+ * If your Terraform is split across workspaces — one per environment, say — only one of them
55
+ * should declare an attribute as a resource. The others should read it with the
56
+ * `incident.AlertAttribute` data source, which looks an attribute up by name:
57
+ *
58
+ * ```typescript
59
+ * import * as pulumi from "@pulumi/pulumi";
60
+ * import * as incident from "@incident-io/pulumi";
61
+ *
62
+ * const gcpService = incident.getAlertAttribute({
63
+ * name: "GCP service",
64
+ * });
65
+ * ```
66
+ *
67
+ * Declaring the same `name` in two workspaces plans cleanly in both, then fails when the second
68
+ * applies: the attribute it means to create already exists. To bring an attribute that already
69
+ * exists under a workspace's management instead, `import` it.
70
+ *
71
+ * Per-environment differences belong on the binding rather than the attribute, so both
72
+ * environments share one attribute and each parses it from its own source.
73
+ *
74
+ * ## Reserved names
75
+ *
76
+ * `Title`, `Description` and `Priority` collide with properties every alert already has, and are
77
+ * rejected regardless of casing. `Priority` does exist as an attribute you can bind and filter on,
78
+ * but it is read-only through the API: read it with the data source rather than declaring it.
79
+ *
80
+ * ## Example Usage
81
+ *
82
+ * ```typescript
83
+ * import * as pulumi from "@pulumi/pulumi";
84
+ * import * as incident from "@incident-io/pulumi";
85
+ *
86
+ * // Create an alert attribute that points at a single Github user in the catalog.
87
+ * //
88
+ * // Take the engine type from the catalog type itself rather than writing it out: a type one
89
+ * // of our integrations owns is referenced by its registry name, and a type you manage by its
90
+ * // ID, so the two don't have the same shape.
91
+ * const githubUser = incident.getCatalogType({
92
+ * typeName: "GithubUser",
93
+ * });
94
+ * const githubUserAlertAttribute = new incident.AlertAttribute("github_user", {
95
+ * name: "Github user",
96
+ * type: githubUser.then(githubUser => githubUser.attributeType),
97
+ * array: false,
98
+ * required: true,
99
+ * });
100
+ * // Create an optional alert attribute for severity information
101
+ * const severity = new incident.AlertAttribute("severity", {
102
+ * name: "Severity",
103
+ * type: "String",
104
+ * array: false,
105
+ * required: false,
106
+ * emoji: "warning",
107
+ * });
108
+ * // An attribute is account-wide, so declare it once. What differs between environments is the
109
+ * // binding that fills it in, which belongs to an alert source.
110
+ * const gcpService = new incident.AlertAttribute("gcp_service", {
111
+ * name: "GCP service",
112
+ * type: "String",
113
+ * array: false,
114
+ * });
115
+ * // Staging and production each parse the same attribute out of their own source, so both
116
+ * // environments' alerts are labelled with one attribute that routes can match on.
117
+ * const gcpServiceStaging = new incident.AlertSourceAttribute("gcp_service_staging", {
118
+ * expression: {
119
+ * operations: [{
120
+ * parse: {
121
+ * "function": "$.resource.labels.service_name",
122
+ * as: "String",
123
+ * },
124
+ * }],
125
+ * startFrom: "payload",
126
+ * },
127
+ * alertSourceId: gcpStaging.id,
128
+ * alertAttributeId: gcpService.id,
129
+ * });
130
+ * const gcpServiceProduction = new incident.AlertSourceAttribute("gcp_service_production", {
131
+ * expression: {
132
+ * operations: [{
133
+ * parse: {
134
+ * "function": "$.resource.labels.service_name",
135
+ * as: "String",
136
+ * },
137
+ * }],
138
+ * startFrom: "payload",
139
+ * },
140
+ * alertSourceId: gcpProduction.id,
141
+ * alertAttributeId: gcpService.id,
142
+ * });
143
+ * // Where a source lives in a different workspace to the attribute it binds, read the attribute
144
+ * // by name rather than declaring it again. Two workspaces declaring the same name will both plan
145
+ * // cleanly, and then the second one to apply will fail.
146
+ * const existingGcpService = incident.getAlertAttribute({
147
+ * name: "GCP service",
148
+ * });
149
+ * const gcpServiceOtherWorkspace = new incident.AlertSourceAttribute("gcp_service_other_workspace", {
150
+ * expression: {
151
+ * operations: [{
152
+ * parse: {
153
+ * "function": "$.resource.labels.service_name",
154
+ * as: "String",
155
+ * },
156
+ * }],
157
+ * startFrom: "payload",
158
+ * },
159
+ * alertSourceId: gcpOther.id,
160
+ * alertAttributeId: existingGcpService.then(existingGcpService => existingGcpService.id),
161
+ * });
162
+ * ```
163
+ */
164
+ class AlertAttribute extends pulumi.CustomResource {
165
+ /**
166
+ * Get an existing AlertAttribute resource's state with the given name, ID, and optional extra
167
+ * properties used to qualify the lookup.
168
+ *
169
+ * @param name The _unique_ name of the resulting resource.
170
+ * @param id The _unique_ provider ID of the resource to lookup.
171
+ * @param state Any extra arguments used during the lookup.
172
+ * @param opts Optional settings to control the behavior of the CustomResource.
173
+ */
174
+ static get(name, id, state, opts) {
175
+ return new AlertAttribute(name, state, { ...opts, id: id });
176
+ }
177
+ /** @internal */
178
+ static __pulumiType = 'incident:index/alertAttribute:AlertAttribute';
179
+ /**
180
+ * Returns true if the given object is an instance of AlertAttribute. This is designed to work even
181
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
182
+ */
183
+ static isInstance(obj) {
184
+ if (obj === undefined || obj === null) {
185
+ return false;
186
+ }
187
+ return obj['__pulumiType'] === AlertAttribute.__pulumiType;
188
+ }
189
+ constructor(name, argsOrState, opts) {
190
+ let resourceInputs = {};
191
+ opts = opts || {};
192
+ if (opts.id) {
193
+ const state = argsOrState;
194
+ resourceInputs["array"] = state?.array;
195
+ resourceInputs["emoji"] = state?.emoji;
196
+ resourceInputs["name"] = state?.name;
197
+ resourceInputs["required"] = state?.required;
198
+ resourceInputs["type"] = state?.type;
199
+ }
200
+ else {
201
+ const args = argsOrState;
202
+ if (args?.array === undefined && !opts.urn) {
203
+ throw new Error("Missing required property 'array'");
204
+ }
205
+ if (args?.type === undefined && !opts.urn) {
206
+ throw new Error("Missing required property 'type'");
207
+ }
208
+ resourceInputs["array"] = args?.array;
209
+ resourceInputs["emoji"] = args?.emoji;
210
+ resourceInputs["name"] = args?.name;
211
+ resourceInputs["required"] = args?.required;
212
+ resourceInputs["type"] = args?.type;
213
+ }
214
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
215
+ super(AlertAttribute.__pulumiType, name, resourceInputs, opts);
216
+ }
217
+ }
218
+ exports.AlertAttribute = AlertAttribute;
219
+ //# sourceMappingURL=alertAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alertAttribute.js","sourceRoot":"","sources":["../alertAttribute.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,uDAAyC;AACzC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoIG;AACH,MAAa,cAAe,SAAQ,MAAM,CAAC,cAAc;IACrD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAA2B,EAAE,IAAmC;QACzH,OAAO,IAAI,cAAc,CAAC,IAAI,EAAO,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,EAAE,EAA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