@checkly/pulumi 0.0.1-alpha.2 → 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 (60) hide show
  1. package/README.md +70 -44
  2. package/alertChannel.ts +56 -141
  3. package/bin/README.md +102 -41
  4. package/bin/alertChannel.d.ts +55 -138
  5. package/bin/alertChannel.js +41 -108
  6. package/bin/alertChannel.js.map +1 -1
  7. package/bin/check.d.ts +90 -51
  8. package/bin/check.js +4 -3
  9. package/bin/check.js.map +1 -1
  10. package/bin/checkGroup.d.ts +112 -36
  11. package/bin/checkGroup.js +89 -3
  12. package/bin/checkGroup.js.map +1 -1
  13. package/bin/dashboard.d.ts +125 -14
  14. package/bin/dashboard.js +22 -24
  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 +2 -33
  24. package/bin/maintenanceWindow.js.map +1 -1
  25. package/bin/package.json +4 -3
  26. package/bin/package.json.bak +2 -1
  27. package/bin/provider.js +1 -3
  28. package/bin/provider.js.map +1 -1
  29. package/bin/snippet.d.ts +3 -3
  30. package/bin/snippet.js +1 -3
  31. package/bin/snippet.js.map +1 -1
  32. package/bin/triggerCheck.d.ts +19 -7
  33. package/bin/triggerCheck.js +2 -10
  34. package/bin/triggerCheck.js.map +1 -1
  35. package/bin/triggerCheckGroup.d.ts +19 -7
  36. package/bin/triggerCheckGroup.js +2 -10
  37. package/bin/triggerCheckGroup.js.map +1 -1
  38. package/bin/types/input.d.ts +2 -188
  39. package/bin/types/input.js.map +1 -1
  40. package/bin/types/output.d.ts +2 -188
  41. package/bin/types/output.js.map +1 -1
  42. package/bin/utilities.js +6 -1
  43. package/bin/utilities.js.map +1 -1
  44. package/bin/yarn.lock +179 -117
  45. package/check.ts +91 -54
  46. package/checkGroup.ts +113 -39
  47. package/dashboard.ts +126 -38
  48. package/environmentVariable.ts +107 -0
  49. package/index.ts +5 -0
  50. package/maintenanceWindow.ts +17 -48
  51. package/package.json +7 -6
  52. package/provider.ts +1 -3
  53. package/scripts/install-pulumi-plugin.js +26 -0
  54. package/snippet.ts +4 -6
  55. package/triggerCheck.ts +20 -10
  56. package/triggerCheckGroup.ts +20 -10
  57. package/tsconfig.json +1 -0
  58. package/types/input.ts +2 -188
  59. package/types/output.ts +2 -188
  60. package/utilities.ts +5 -0
package/README.md CHANGED
@@ -1,52 +1,42 @@
1
- **⚠️ This project is still in very early stages and breaking change could happen**
1
+ # Checkly Pulumi Provider
2
2
 
3
- <p align="center">
4
- <img width="400px" src="./assets/pulumi.svg" alt="Pulumi" />
5
- </p>
6
-
7
- <p>
8
- <img height="128" src="./assets/checkly.svg" align="right" />
9
- <h1>Checkly Pulumi Provider</h1>
10
- </p>
11
-
12
- > 🟪 Pulumi provider for the [Checkly](https://checklyhq.com) Delightful Active Monitoring
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.
13
5
 
14
- <br>
15
-
16
- ## 🪛 Installing
6
+ ## Installation
17
7
 
18
- 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.
19
10
 
20
11
  ### Node.js (JavaScript/TypeScript)
21
12
 
22
13
  To use from JavaScript or TypeScript in Node.js, install using either `npm`:
23
14
 
24
15
  ```bash
25
- npm install @pulumi/checkly
16
+ npm install @checkly/pulumi
26
17
  ```
27
18
 
28
19
  or `yarn`:
29
20
 
30
21
  ```bash
31
- yarn add @pulumi/checkly
22
+ yarn add @checkly/pulumi
32
23
  ```
33
24
 
34
- ### Python
35
- > TBA
25
+ Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry
36
26
 
37
- ### Go
38
- > 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
+ ```
39
30
 
40
- ### .NET
41
- > TBA
31
+ ### Python, Go & .NET
42
32
 
43
- <br>
33
+ *TBA*
44
34
 
45
- ## 🔑 Authentication
35
+ ## Authentication
46
36
 
47
- The Pulumi Checkly Provider needs to be configured with Checkly `API Key` and `Account ID` before it can be used to create resources.
37
+ The Pulumi Checkly Provider needs to be configured with a Checkly `API Key` and `Account ID` before it can be used to create resources.
48
38
 
49
- > If you don't have and `API Key`, you can create one [here](https://app.checklyhq.com/settings/user/api-keys).
39
+ > If you don't have an `API Key`, you can create one [here](https://app.checklyhq.com/settings/user/api-keys).
50
40
 
51
41
  Once you generated the `API Key` there are two ways to communicate your authorization tokens to Pulumi:
52
42
 
@@ -64,50 +54,86 @@ Once you generated the `API Key` there are two ways to communicate your authoriz
64
54
 
65
55
  > Remember to pass `--secret` when setting `checkly:apiKey` so it is properly encrypted.
66
56
 
67
- <br>
68
-
57
+ ## Creating Resources
69
58
 
70
- ## 🦝 Creating Resources
59
+ The example below shows a basic API check and Browser check.
71
60
 
72
61
  ```javascript
62
+ // index.js
73
63
  const checkly = require("@checkly/pulumi")
74
64
 
75
65
  new checkly.Check("api-check", {
66
+ type: "API",
67
+ name: "Public SpaceX API",
76
68
  activated: true,
77
69
  frequency: 10,
78
- type: "API",
70
+ locations: ["us-east-1"],
79
71
  request: {
80
72
  method: "GET",
81
- url: "https://checklyhq.com",
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
+ ]
82
87
  }
83
88
  })
84
89
 
85
- new checkly.Check("brwoser-check", {
90
+ new checkly.Check("browser-check", {
91
+ type: "BROWSER",
92
+ name: "Google.com Playwright check",
86
93
  activated: true,
87
94
  frequency: 10,
88
- type: "BROWSER",
89
- script: 'console.log("Hello World!")'
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()`
90
115
  })
91
116
  ```
92
117
 
93
- > 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.
94
119
 
95
- ## ⚙️ Configuration
120
+ ## Syncing resources
121
+
122
+ Just run the regular `pulumi up` command
123
+
124
+
125
+ ## Configuration
96
126
 
97
127
  The following configuration points are available for the `foo` provider:
98
128
 
99
129
  - `checkly:apiKey` (environment: `CHECKLY_API_KEY`) - the Checkly API Key.
100
130
  - `checkly:accountId` (environment: `CHECKLY_ACCOUNT_ID`) - the Checkly account ID.
101
131
 
102
- <br>
103
-
104
- ## 📖 Reference
132
+ ## Reference
105
133
 
106
134
  For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/checkly/api-docs/).
107
135
 
108
- <br>
109
-
110
- ## 📄 License
136
+ ## License
111
137
 
112
138
  [MIT](https://github.com/checkly/pulumi-checkly/blob/main/LICENSE)
113
139
 
@@ -115,7 +141,7 @@ For detailed reference documentation, please visit [the Pulumi registry](https:/
115
141
 
116
142
 
117
143
  <p align="center">
118
- <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">
119
145
  <img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
120
146
  </a>
121
147
  <br />
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 checkly from "@pulumi/checkly";
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,
115
- * activated: true,
116
- * },
117
- * {
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 checkly from "@pulumi/checkly";
128
- *
129
- * const test_group1 = new checkly.CheckGroup("test-group1", {alertChannelSubscriptions: [
130
- * {
131
- * channelId: checkly_alert_channel.email_ac.id,
66
+ * channelId: emailAc.id,
132
67
  * activated: true,
133
68
  * },
134
69
  * {
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>;
@@ -237,9 +166,7 @@ export class AlertChannel extends pulumi.CustomResource {
237
166
  resourceInputs["sslExpiryThreshold"] = args ? args.sslExpiryThreshold : undefined;
238
167
  resourceInputs["webhook"] = args ? args.webhook : undefined;
239
168
  }
240
- if (!opts.version) {
241
- opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
242
- }
169
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
243
170
  super(AlertChannel.__pulumiType, name, resourceInputs, opts);
244
171
  }
245
172
  }
@@ -248,35 +175,29 @@ export class AlertChannel extends pulumi.CustomResource {
248
175
  * Input properties used for looking up and filtering AlertChannel resources.
249
176
  */
250
177
  export interface AlertChannelState {
251
- /**
252
- * :
253
- */
254
178
  email?: pulumi.Input<inputs.AlertChannelEmail>;
255
179
  opsgenie?: pulumi.Input<inputs.AlertChannelOpsgenie>;
256
180
  pagerduty?: pulumi.Input<inputs.AlertChannelPagerduty>;
257
181
  /**
258
- * . Possible values: `true` | `false`.
182
+ * (Default `false`)
259
183
  */
260
184
  sendDegraded?: pulumi.Input<boolean>;
261
185
  /**
262
- * . Possible values: `true` | `false`.
186
+ * (Default `true`)
263
187
  */
264
188
  sendFailure?: pulumi.Input<boolean>;
265
189
  /**
266
- * . Possible values: `true` | `false`.
190
+ * (Default `true`)
267
191
  */
268
192
  sendRecovery?: pulumi.Input<boolean>;
269
193
  slack?: pulumi.Input<inputs.AlertChannelSlack>;
270
- /**
271
- * :
272
- */
273
194
  sms?: pulumi.Input<inputs.AlertChannelSms>;
274
195
  /**
275
- * . Possible values: `true` | `false`.
196
+ * (Default `false`)
276
197
  */
277
198
  sslExpiry?: pulumi.Input<boolean>;
278
199
  /**
279
- * . Possible values between 1 and 30. Default is `30`.
200
+ * Value must be between 1 and 30 (Default `30`)
280
201
  */
281
202
  sslExpiryThreshold?: pulumi.Input<number>;
282
203
  webhook?: pulumi.Input<inputs.AlertChannelWebhook>;
@@ -286,35 +207,29 @@ export interface AlertChannelState {
286
207
  * The set of arguments for constructing a AlertChannel resource.
287
208
  */
288
209
  export interface AlertChannelArgs {
289
- /**
290
- * :
291
- */
292
210
  email?: pulumi.Input<inputs.AlertChannelEmail>;
293
211
  opsgenie?: pulumi.Input<inputs.AlertChannelOpsgenie>;
294
212
  pagerduty?: pulumi.Input<inputs.AlertChannelPagerduty>;
295
213
  /**
296
- * . Possible values: `true` | `false`.
214
+ * (Default `false`)
297
215
  */
298
216
  sendDegraded?: pulumi.Input<boolean>;
299
217
  /**
300
- * . Possible values: `true` | `false`.
218
+ * (Default `true`)
301
219
  */
302
220
  sendFailure?: pulumi.Input<boolean>;
303
221
  /**
304
- * . Possible values: `true` | `false`.
222
+ * (Default `true`)
305
223
  */
306
224
  sendRecovery?: pulumi.Input<boolean>;
307
225
  slack?: pulumi.Input<inputs.AlertChannelSlack>;
308
- /**
309
- * :
310
- */
311
226
  sms?: pulumi.Input<inputs.AlertChannelSms>;
312
227
  /**
313
- * . Possible values: `true` | `false`.
228
+ * (Default `false`)
314
229
  */
315
230
  sslExpiry?: pulumi.Input<boolean>;
316
231
  /**
317
- * . Possible values between 1 and 30. Default is `30`.
232
+ * Value must be between 1 and 30 (Default `30`)
318
233
  */
319
234
  sslExpiryThreshold?: pulumi.Input<number>;
320
235
  webhook?: pulumi.Input<inputs.AlertChannelWebhook>;
package/bin/README.md CHANGED
@@ -1,78 +1,139 @@
1
- **🚨 This project is still in very early stages and is not stable, _use at your own risk_! 🚨**
1
+ # Checkly Pulumi Provider
2
2
 
3
- <p align="center">
4
- <img width="400px" src="./assets/pulumi.svg" alt="Pulumi" />
5
- </p>
6
-
7
- <p>
8
- <img height="128" src="./assets/checkly.svg" align="right" />
9
- <h1>Checkly Pulumi Provider</h1>
10
- </p>
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.
11
5
 
12
- > 🟪 Pulumi provider for the [Checkly](https://checklyhq.com) Delightful Active Monitoring
13
-
14
- <br>
6
+ ## Installation
15
7
 
16
- ## 🪛 Installing
17
-
18
- This package is available for several languages/platforms:
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.
19
10
 
20
11
  ### Node.js (JavaScript/TypeScript)
21
12
 
22
13
  To use from JavaScript or TypeScript in Node.js, install using either `npm`:
23
14
 
24
15
  ```bash
25
- npm install @pulumi/checkly
16
+ npm install @checkly/pulumi
26
17
  ```
27
18
 
28
19
  or `yarn`:
29
20
 
30
21
  ```bash
31
- yarn add @pulumi/checkly
22
+ yarn add @checkly/pulumi
32
23
  ```
33
24
 
34
- ### Python
35
-
36
- To use from Python, install using `pip`:
25
+ Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry
37
26
 
38
27
  ```bash
39
- pip install pulumi_checkly
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
40
29
  ```
41
30
 
42
- ### Go
43
-
44
- To use from Go, use `go get` to grab the latest version of the library:
45
-
46
- ```bash
47
- go get github.com/pulumi/pulumi-checkly/sdk/go/...
31
+ ### Python, Go & .NET
32
+
33
+ *TBA*
34
+
35
+ ## Authentication
36
+
37
+ The Pulumi Checkly Provider needs to be configured with a Checkly `API Key` and `Account ID` before it can be used to create resources.
38
+
39
+ > If you don't have an `API Key`, you can create one [here](https://app.checklyhq.com/settings/user/api-keys).
40
+
41
+ Once you generated the `API Key` there are two ways to communicate your authorization tokens to Pulumi:
42
+
43
+ 1. Set the environment variables `CHECKLY_API_KEY` and `CHECKLY_ACCOUNT_ID`:
44
+ ```bash
45
+ $ export CHECKLY_API_KEY=cu_xxx
46
+ $ export CHECKLY_ACCOUNT_ID=xxx
47
+ ```
48
+
49
+ 2. Set them using `pulumi config` command, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access:
50
+ ```bash
51
+ $ pulumi config set checkly:apiKey cu_xxx --secret
52
+ $ pulumi config set checkly:accountId xxx
53
+ ```
54
+
55
+ > Remember to pass `--secret` when setting `checkly:apiKey` so it is properly encrypted.
56
+
57
+ ## Creating Resources
58
+
59
+ The example below shows a basic API check and Browser check.
60
+
61
+ ```javascript
62
+ // index.js
63
+ const checkly = require("@checkly/pulumi")
64
+
65
+ new checkly.Check("api-check", {
66
+ type: "API",
67
+ name: "Public SpaceX API",
68
+ activated: true,
69
+ frequency: 10,
70
+ locations: ["us-east-1"],
71
+ request: {
72
+ method: "GET",
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
+ ]
87
+ }
88
+ })
89
+
90
+ new checkly.Check("browser-check", {
91
+ type: "BROWSER",
92
+ name: "Google.com Playwright check",
93
+ activated: true,
94
+ frequency: 10,
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()`
115
+ })
48
116
  ```
49
117
 
50
- ### .NET
118
+ > Check the [examples directory](https://github.com/checkly/pulumi-checkly/tree/main/examples) for more detailed code samples.
51
119
 
52
- To use from .NET, install using `dotnet add package`:
120
+ ## Syncing resources
53
121
 
54
- ```bash
55
- dotnet add package Pulumi.Checkly
56
- ```
122
+ Just run the regular `pulumi up` command
57
123
 
58
- <br>
59
124
 
60
- ## ⚙️ Configuration
125
+ ## Configuration
61
126
 
62
127
  The following configuration points are available for the `foo` provider:
63
128
 
64
129
  - `checkly:apiKey` (environment: `CHECKLY_API_KEY`) - the Checkly API Key.
65
130
  - `checkly:accountId` (environment: `CHECKLY_ACCOUNT_ID`) - the Checkly account ID.
66
131
 
67
- <br>
68
-
69
- ## 📖 Reference
132
+ ## Reference
70
133
 
71
134
  For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/checkly/api-docs/).
72
135
 
73
- <br>
74
-
75
- ## 📄 License
136
+ ## License
76
137
 
77
138
  [MIT](https://github.com/checkly/pulumi-checkly/blob/main/LICENSE)
78
139
 
@@ -80,7 +141,7 @@ For detailed reference documentation, please visit [the Pulumi registry](https:/
80
141
 
81
142
 
82
143
  <p align="center">
83
- <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">
84
145
  <img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
85
146
  </a>
86
147
  <br />