@checkly/pulumi 0.0.1-alpha.4 → 0.0.1-alpha.6

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 (50) hide show
  1. package/README.md +2 -3
  2. package/alertChannel.ts +55 -138
  3. package/bin/README.md +58 -15
  4. package/bin/alertChannel.d.ts +55 -138
  5. package/bin/alertChannel.js +40 -105
  6. package/bin/alertChannel.js.map +1 -1
  7. package/bin/check.d.ts +90 -51
  8. package/bin/check.js +3 -0
  9. package/bin/check.js.map +1 -1
  10. package/bin/checkGroup.d.ts +112 -36
  11. package/bin/checkGroup.js +88 -0
  12. package/bin/checkGroup.js.map +1 -1
  13. package/bin/dashboard.d.ts +125 -14
  14. package/bin/dashboard.js +21 -21
  15. package/bin/dashboard.js.map +1 -1
  16. package/bin/environmentVariable.d.ts +64 -0
  17. package/bin/environmentVariable.js +78 -0
  18. package/bin/environmentVariable.js.map +1 -0
  19. package/bin/index.d.ts +1 -0
  20. package/bin/index.js +5 -0
  21. package/bin/index.js.map +1 -1
  22. package/bin/maintenanceWindow.d.ts +16 -36
  23. package/bin/maintenanceWindow.js +1 -30
  24. package/bin/maintenanceWindow.js.map +1 -1
  25. package/bin/package.json +3 -3
  26. package/bin/snippet.d.ts +3 -3
  27. package/bin/triggerCheck.d.ts +18 -6
  28. package/bin/triggerCheck.js +0 -6
  29. package/bin/triggerCheck.js.map +1 -1
  30. package/bin/triggerCheckGroup.d.ts +18 -6
  31. package/bin/triggerCheckGroup.js +0 -6
  32. package/bin/triggerCheckGroup.js.map +1 -1
  33. package/bin/types/input.d.ts +2 -188
  34. package/bin/types/input.js.map +1 -1
  35. package/bin/types/output.d.ts +2 -188
  36. package/bin/types/output.js.map +1 -1
  37. package/bin/yarn.lock +179 -117
  38. package/check.ts +90 -51
  39. package/checkGroup.ts +112 -36
  40. package/dashboard.ts +125 -35
  41. package/environmentVariable.ts +107 -0
  42. package/index.ts +5 -0
  43. package/maintenanceWindow.ts +16 -45
  44. package/package.json +29 -29
  45. package/snippet.ts +3 -3
  46. package/triggerCheck.ts +18 -6
  47. package/triggerCheckGroup.ts +18 -6
  48. package/tsconfig.json +1 -0
  49. package/types/input.ts +2 -188
  50. package/types/output.ts +2 -188
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
- **⚠️ This project is still in very early stages and breaking changes could happen**
2
-
3
1
  # Checkly Pulumi Provider
4
2
 
5
3
  The Checkly Pulumi provider enables you to create and configure Checkly resources using your favourite programming language.
4
+ Note that this project is in its early stages and breaking changes could happen.
6
5
 
7
6
  ## Installation
8
7
 
@@ -26,7 +25,7 @@ yarn add @checkly/pulumi
26
25
  Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry
27
26
 
28
27
  ```bash
29
- pulumi plugin install resource checkly v0.0.1-alpha.1 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.1
28
+ pulumi plugin install resource checkly v0.0.1-alpha.5 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.5
30
29
  ```
31
30
 
32
31
  ### Python, Go & .NET
package/alertChannel.ts CHANGED
@@ -6,133 +6,68 @@ import { input as inputs, output as outputs } from "./types";
6
6
  import * as utilities from "./utilities";
7
7
 
8
8
  /**
9
- * ## # checkly.AlertChannel
10
- *
11
- * The `checkly.AlertChannel` resource allows users to manage Checkly alert channels.
12
- *
13
- * Checkly's Alert Channels feature allows you to define global alerting channels for the checks in your account:
9
+ * Allows you to define alerting channels for the checks and groups in your account
14
10
  *
15
11
  * ## Example Usage
16
12
  *
17
- * *An Email alert channel*
18
13
  * ```typescript
19
14
  * import * as pulumi from "@pulumi/pulumi";
20
- * import * as checkly from "@pulumi/checkly";
15
+ * import * as pulumi from "@checkly/pulumi";
21
16
  *
22
- * const emailAc = new checkly.AlertChannel("email_ac", {
17
+ * // An Email alert channel
18
+ * const emailAc = new checkly.AlertChannel("emailAc", {
23
19
  * email: {
24
20
  * address: "john@example.com",
25
21
  * },
26
- * sendDegraded: true,
27
- * sendFailure: false,
28
22
  * sendRecovery: true,
23
+ * sendFailure: false,
24
+ * sendDegraded: true,
29
25
  * sslExpiry: true,
30
26
  * sslExpiryThreshold: 22,
31
27
  * });
32
- * ```
33
- *
34
- * *A SMS alert channel*
35
- * ```typescript
36
- * import * as pulumi from "@pulumi/pulumi";
37
- * import * as checkly from "@pulumi/checkly";
38
- *
39
- * const smsAc = new checkly.AlertChannel("sms_ac", {
40
- * sendFailure: true,
41
- * sendRecovery: true,
28
+ * // A SMS alert channel
29
+ * const smsAc = new checkly.AlertChannel("smsAc", {
42
30
  * sms: {
43
31
  * name: "john",
44
- * number: "0123456789",
45
- * },
46
- * });
47
- * ```
48
- *
49
- * *A Slack alert channel*
50
- * ```typescript
51
- * import * as pulumi from "@pulumi/pulumi";
52
- * import * as checkly from "@pulumi/checkly";
53
- *
54
- * const slackAc = new checkly.AlertChannel("slack_ac", {
55
- * slack: {
56
- * channel: "#checkly-notifications",
57
- * url: "https://slack.com/webhook",
58
- * },
59
- * });
60
- * ```
61
- *
62
- * *An Opsgenie alert channel*
63
- * ```typescript
64
- * import * as pulumi from "@pulumi/pulumi";
65
- * import * as checkly from "@pulumi/checkly";
66
- *
67
- * const opsgenieAc = new checkly.AlertChannel("opsgenie_ac", {
68
- * opsgenie: {
69
- * apiKey: "fookey",
70
- * name: "opsalerts",
71
- * priority: "foopriority",
72
- * region: "fooregion",
73
- * },
74
- * });
75
- * ```
76
- *
77
- * *An Pagerduty alert channel*
78
- * ```typescript
79
- * import * as pulumi from "@pulumi/pulumi";
80
- * import * as checkly from "@pulumi/checkly";
81
- *
82
- * const pagerdutyAc = new checkly.AlertChannel("pagerduty_ac", {
83
- * pagerduty: {
84
- * account: "checkly",
85
- * serviceKey: "key1",
86
- * serviceName: "pdalert",
87
- * },
88
- * });
89
- * ```
90
- *
91
- * *An Webhook alert channel*
92
- * ```typescript
93
- * import * as pulumi from "@pulumi/pulumi";
94
- * import * as checkly from "@pulumi/checkly";
95
- *
96
- * const webhookAc = new checkly.AlertChannel("webhook_ac", {
97
- * webhook: {
98
- * method: "get",
99
- * name: "foo",
100
- * template: "footemplate",
101
- * url: "http://example.com/foo",
102
- * webhookSecret: "foosecret",
32
+ * number: "+5491100001111",
103
33
  * },
34
+ * sendRecovery: true,
35
+ * sendFailure: true,
104
36
  * });
105
- * ```
106
- *
107
- * *Connecting the alert channel to a check
108
- * ```typescript
109
- * import * as pulumi from "@pulumi/pulumi";
110
- * import * as pulumi from "@checkly/pulumi";
111
- *
37
+ * // A Slack alert channel
38
+ * const slackAc = new checkly.AlertChannel("slackAc", {slack: {
39
+ * channel: "#checkly-notifications",
40
+ * url: "https://slack.com/webhook",
41
+ * }});
42
+ * // An Opsgenie alert channel
43
+ * const opsgenieAc = new checkly.AlertChannel("opsgenieAc", {opsgenie: {
44
+ * name: "opsalerts",
45
+ * apiKey: "fookey",
46
+ * region: "fooregion",
47
+ * priority: "foopriority",
48
+ * }});
49
+ * // An Pagerduty alert channel
50
+ * const pagerdutyAc = new checkly.AlertChannel("pagerdutyAc", {pagerduty: {
51
+ * account: "checkly",
52
+ * serviceKey: "key1",
53
+ * serviceName: "pdalert",
54
+ * }});
55
+ * // An Webhook alert channel
56
+ * const webhookAc = new checkly.AlertChannel("webhookAc", {webhook: {
57
+ * name: "foo",
58
+ * method: "get",
59
+ * template: "footemplate",
60
+ * url: "https://example.com/foo",
61
+ * webhookSecret: "foosecret",
62
+ * }});
63
+ * // Connecting the alert channel to a check
112
64
  * const example_check = new checkly.Check("example-check", {alertChannelSubscriptions: [
113
65
  * {
114
- * channelId: checkly_alert_channel.email_ac.id,
66
+ * channelId: emailAc.id,
115
67
  * activated: true,
116
68
  * },
117
69
  * {
118
- * channelId: checkly_alert_channel.sms_ac.id,
119
- * activated: true,
120
- * },
121
- * ]});
122
- * ```
123
- *
124
- * *Connecting the alert channel to a check group
125
- * ```typescript
126
- * import * as pulumi from "@pulumi/pulumi";
127
- * import * as pulumi from "@checkly/pulumi";
128
- *
129
- * const test_group1 = new checkly.CheckGroup("test-group1", {alertChannelSubscriptions: [
130
- * {
131
- * channelId: checkly_alert_channel.email_ac.id,
132
- * activated: true,
133
- * },
134
- * {
135
- * channelId: checkly_alert_channel.sms_ac.id,
70
+ * channelId: smsAc.id,
136
71
  * activated: true,
137
72
  * },
138
73
  * ]});
@@ -166,35 +101,29 @@ export class AlertChannel extends pulumi.CustomResource {
166
101
  return obj['__pulumiType'] === AlertChannel.__pulumiType;
167
102
  }
168
103
 
169
- /**
170
- * :
171
- */
172
104
  public readonly email!: pulumi.Output<outputs.AlertChannelEmail | undefined>;
173
105
  public readonly opsgenie!: pulumi.Output<outputs.AlertChannelOpsgenie | undefined>;
174
106
  public readonly pagerduty!: pulumi.Output<outputs.AlertChannelPagerduty | undefined>;
175
107
  /**
176
- * . Possible values: `true` | `false`.
108
+ * (Default `false`)
177
109
  */
178
110
  public readonly sendDegraded!: pulumi.Output<boolean | undefined>;
179
111
  /**
180
- * . Possible values: `true` | `false`.
112
+ * (Default `true`)
181
113
  */
182
114
  public readonly sendFailure!: pulumi.Output<boolean | undefined>;
183
115
  /**
184
- * . Possible values: `true` | `false`.
116
+ * (Default `true`)
185
117
  */
186
118
  public readonly sendRecovery!: pulumi.Output<boolean | undefined>;
187
119
  public readonly slack!: pulumi.Output<outputs.AlertChannelSlack | undefined>;
188
- /**
189
- * :
190
- */
191
120
  public readonly sms!: pulumi.Output<outputs.AlertChannelSms | undefined>;
192
121
  /**
193
- * . Possible values: `true` | `false`.
122
+ * (Default `false`)
194
123
  */
195
124
  public readonly sslExpiry!: pulumi.Output<boolean | undefined>;
196
125
  /**
197
- * . Possible values between 1 and 30. Default is `30`.
126
+ * Value must be between 1 and 30 (Default `30`)
198
127
  */
199
128
  public readonly sslExpiryThreshold!: pulumi.Output<number | undefined>;
200
129
  public readonly webhook!: pulumi.Output<outputs.AlertChannelWebhook | undefined>;
@@ -246,35 +175,29 @@ export class AlertChannel extends pulumi.CustomResource {
246
175
  * Input properties used for looking up and filtering AlertChannel resources.
247
176
  */
248
177
  export interface AlertChannelState {
249
- /**
250
- * :
251
- */
252
178
  email?: pulumi.Input<inputs.AlertChannelEmail>;
253
179
  opsgenie?: pulumi.Input<inputs.AlertChannelOpsgenie>;
254
180
  pagerduty?: pulumi.Input<inputs.AlertChannelPagerduty>;
255
181
  /**
256
- * . Possible values: `true` | `false`.
182
+ * (Default `false`)
257
183
  */
258
184
  sendDegraded?: pulumi.Input<boolean>;
259
185
  /**
260
- * . Possible values: `true` | `false`.
186
+ * (Default `true`)
261
187
  */
262
188
  sendFailure?: pulumi.Input<boolean>;
263
189
  /**
264
- * . Possible values: `true` | `false`.
190
+ * (Default `true`)
265
191
  */
266
192
  sendRecovery?: pulumi.Input<boolean>;
267
193
  slack?: pulumi.Input<inputs.AlertChannelSlack>;
268
- /**
269
- * :
270
- */
271
194
  sms?: pulumi.Input<inputs.AlertChannelSms>;
272
195
  /**
273
- * . Possible values: `true` | `false`.
196
+ * (Default `false`)
274
197
  */
275
198
  sslExpiry?: pulumi.Input<boolean>;
276
199
  /**
277
- * . Possible values between 1 and 30. Default is `30`.
200
+ * Value must be between 1 and 30 (Default `30`)
278
201
  */
279
202
  sslExpiryThreshold?: pulumi.Input<number>;
280
203
  webhook?: pulumi.Input<inputs.AlertChannelWebhook>;
@@ -284,35 +207,29 @@ export interface AlertChannelState {
284
207
  * The set of arguments for constructing a AlertChannel resource.
285
208
  */
286
209
  export interface AlertChannelArgs {
287
- /**
288
- * :
289
- */
290
210
  email?: pulumi.Input<inputs.AlertChannelEmail>;
291
211
  opsgenie?: pulumi.Input<inputs.AlertChannelOpsgenie>;
292
212
  pagerduty?: pulumi.Input<inputs.AlertChannelPagerduty>;
293
213
  /**
294
- * . Possible values: `true` | `false`.
214
+ * (Default `false`)
295
215
  */
296
216
  sendDegraded?: pulumi.Input<boolean>;
297
217
  /**
298
- * . Possible values: `true` | `false`.
218
+ * (Default `true`)
299
219
  */
300
220
  sendFailure?: pulumi.Input<boolean>;
301
221
  /**
302
- * . Possible values: `true` | `false`.
222
+ * (Default `true`)
303
223
  */
304
224
  sendRecovery?: pulumi.Input<boolean>;
305
225
  slack?: pulumi.Input<inputs.AlertChannelSlack>;
306
- /**
307
- * :
308
- */
309
226
  sms?: pulumi.Input<inputs.AlertChannelSms>;
310
227
  /**
311
- * . Possible values: `true` | `false`.
228
+ * (Default `false`)
312
229
  */
313
230
  sslExpiry?: pulumi.Input<boolean>;
314
231
  /**
315
- * . Possible values between 1 and 30. Default is `30`.
232
+ * Value must be between 1 and 30 (Default `30`)
316
233
  */
317
234
  sslExpiryThreshold?: pulumi.Input<number>;
318
235
  webhook?: pulumi.Input<inputs.AlertChannelWebhook>;
package/bin/README.md CHANGED
@@ -1,13 +1,12 @@
1
- **⚠️ This project is still in very early stages and breaking changes could happen**
2
-
3
1
  # Checkly Pulumi Provider
4
2
 
5
3
  The Checkly Pulumi provider enables you to create and configure Checkly resources using your favourite programming language.
4
+ Note that this project is in its early stages and breaking changes could happen.
6
5
 
7
6
  ## Installation
8
7
 
9
- 1. To use this package, please install the Pulumi CLI first.
10
- 2. This package is only available for JavaScript and TypeScript but support for other languages/platforms, will be available soon.
8
+ 1. To use this package, please [install the Pulumi CLI first](https://www.pulumi.com/docs/get-started/install/).
9
+ 2. This package is only available for JavaScript and TypeScript but support for other languages will be available soon.
11
10
 
12
11
  ### Node.js (JavaScript/TypeScript)
13
12
 
@@ -23,14 +22,15 @@ or `yarn`:
23
22
  yarn add @checkly/pulumi
24
23
  ```
25
24
 
26
- ### Python
27
- > TBA
25
+ Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry
28
26
 
29
- ### Go
30
- > TBA
27
+ ```bash
28
+ pulumi plugin install resource checkly v0.0.1-alpha.5 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.5
29
+ ```
31
30
 
32
- ### .NET
33
- > TBA
31
+ ### Python, Go & .NET
32
+
33
+ *TBA*
34
34
 
35
35
  ## Authentication
36
36
 
@@ -56,28 +56,71 @@ Once you generated the `API Key` there are two ways to communicate your authoriz
56
56
 
57
57
  ## Creating Resources
58
58
 
59
+ The example below shows a basic API check and Browser check.
60
+
59
61
  ```javascript
62
+ // index.js
60
63
  const checkly = require("@checkly/pulumi")
61
64
 
62
65
  new checkly.Check("api-check", {
66
+ type: "API",
67
+ name: "Public SpaceX API",
63
68
  activated: true,
64
69
  frequency: 10,
65
- type: "API",
70
+ locations: ["us-east-1"],
66
71
  request: {
67
72
  method: "GET",
68
73
  url: "https://api.spacexdata.com/v3",
74
+ assertions: [
75
+ {
76
+ source: 'STATUS_CODE',
77
+ comparison: 'EQUALS',
78
+ target: 200
79
+ },
80
+ {
81
+ source: 'JSON_BODY',
82
+ property: '$.project_name',
83
+ comparison: 'EQUALS',
84
+ target: 'SpaceX-API'
85
+ }
86
+ ]
69
87
  }
70
88
  })
71
89
 
72
90
  new checkly.Check("browser-check", {
91
+ type: "BROWSER",
92
+ name: "Google.com Playwright check",
73
93
  activated: true,
74
94
  frequency: 10,
75
- type: "BROWSER",
76
- script: `console`
95
+ locations: ["us-east-1"],
96
+ script: `const { chromium } = require('playwright')
97
+
98
+ async function run () {
99
+ const browser = await chromium.launch()
100
+ const page = await browser.newPage()
101
+
102
+ const response = await page.goto('https://google.com')
103
+
104
+ if (response.status() > 399) {
105
+ throw new Error('Failed with response code ${response.status()}')
106
+ }
107
+
108
+ await page.screenshot({ path: 'screenshot.jpg' })
109
+
110
+ await page.close()
111
+ await browser.close()
112
+ }
113
+
114
+ run()`
77
115
  })
78
116
  ```
79
117
 
80
- > Check the `examples` directory for more detailed code samples.
118
+ > Check the [examples directory](https://github.com/checkly/pulumi-checkly/tree/main/examples) for more detailed code samples.
119
+
120
+ ## Syncing resources
121
+
122
+ Just run the regular `pulumi up` command
123
+
81
124
 
82
125
  ## Configuration
83
126
 
@@ -98,7 +141,7 @@ For detailed reference documentation, please visit [the Pulumi registry](https:/
98
141
 
99
142
 
100
143
  <p align="center">
101
- <a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=headless-recorder" target="_blank">
144
+ <a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=pulumi-checkly" target="_blank">
102
145
  <img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
103
146
  </a>
104
147
  <br />