@checkly/pulumi 0.0.1-alpha.1 → 0.0.1-alpha.10
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.
- package/README.md +151 -4
- package/alertChannel.ts +56 -141
- package/bin/README.md +102 -41
- package/bin/alertChannel.d.ts +55 -138
- package/bin/alertChannel.js +41 -108
- package/bin/alertChannel.js.map +1 -1
- package/bin/check.d.ts +90 -51
- package/bin/check.js +4 -3
- package/bin/check.js.map +1 -1
- package/bin/checkGroup.d.ts +112 -36
- package/bin/checkGroup.js +89 -3
- package/bin/checkGroup.js.map +1 -1
- package/bin/dashboard.d.ts +125 -14
- package/bin/dashboard.js +22 -24
- package/bin/dashboard.js.map +1 -1
- package/bin/environmentVariable.d.ts +64 -0
- package/bin/environmentVariable.js +78 -0
- package/bin/environmentVariable.js.map +1 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +5 -0
- package/bin/index.js.map +1 -1
- package/bin/maintenanceWindow.d.ts +16 -36
- package/bin/maintenanceWindow.js +2 -33
- package/bin/maintenanceWindow.js.map +1 -1
- package/bin/package.json +5 -4
- package/bin/package.json.bak +4 -3
- package/bin/provider.js +1 -3
- package/bin/provider.js.map +1 -1
- package/bin/snippet.d.ts +3 -3
- package/bin/snippet.js +1 -3
- package/bin/snippet.js.map +1 -1
- package/bin/triggerCheck.d.ts +19 -7
- package/bin/triggerCheck.js +2 -10
- package/bin/triggerCheck.js.map +1 -1
- package/bin/triggerCheckGroup.d.ts +19 -7
- package/bin/triggerCheckGroup.js +2 -10
- package/bin/triggerCheckGroup.js.map +1 -1
- package/bin/types/input.d.ts +2 -188
- package/bin/types/input.js.map +1 -1
- package/bin/types/output.d.ts +2 -188
- package/bin/types/output.js.map +1 -1
- package/bin/utilities.js +6 -1
- package/bin/utilities.js.map +1 -1
- package/bin/yarn.lock +180 -118
- package/check.ts +91 -54
- package/checkGroup.ts +113 -39
- package/dashboard.ts +126 -38
- package/environmentVariable.ts +107 -0
- package/index.ts +5 -0
- package/maintenanceWindow.ts +17 -48
- package/package.json +8 -7
- package/provider.ts +1 -3
- package/scripts/install-pulumi-plugin.js +26 -0
- package/snippet.ts +4 -6
- package/triggerCheck.ts +20 -10
- package/triggerCheckGroup.ts +20 -10
- package/tsconfig.json +1 -0
- package/types/input.ts +2 -188
- package/types/output.ts +2 -188
- package/utilities.ts +5 -0
package/README.md
CHANGED
|
@@ -1,4 +1,151 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
# Checkly Pulumi Provider
|
|
2
|
+
|
|
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.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
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.
|
|
10
|
+
|
|
11
|
+
### Node.js (JavaScript/TypeScript)
|
|
12
|
+
|
|
13
|
+
To use from JavaScript or TypeScript in Node.js, install using either `npm`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @checkly/pulumi
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
or `yarn`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add @checkly/pulumi
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry
|
|
26
|
+
|
|
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
|
+
```
|
|
30
|
+
|
|
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
|
+
})
|
|
116
|
+
```
|
|
117
|
+
|
|
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
|
+
|
|
124
|
+
|
|
125
|
+
## Configuration
|
|
126
|
+
|
|
127
|
+
The following configuration points are available for the `foo` provider:
|
|
128
|
+
|
|
129
|
+
- `checkly:apiKey` (environment: `CHECKLY_API_KEY`) - the Checkly API Key.
|
|
130
|
+
- `checkly:accountId` (environment: `CHECKLY_ACCOUNT_ID`) - the Checkly account ID.
|
|
131
|
+
|
|
132
|
+
## Reference
|
|
133
|
+
|
|
134
|
+
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/checkly/api-docs/).
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
[MIT](https://github.com/checkly/pulumi-checkly/blob/main/LICENSE)
|
|
139
|
+
|
|
140
|
+
<br>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<p align="center">
|
|
144
|
+
<a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=pulumi-checkly" target="_blank">
|
|
145
|
+
<img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
|
|
146
|
+
</a>
|
|
147
|
+
<br />
|
|
148
|
+
<i><sub>Delightful Active Monitoring for Developers</sub></i>
|
|
149
|
+
<br>
|
|
150
|
+
<b><sub>From Checkly with ♥️</sub></b>
|
|
151
|
+
<p>
|
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
|
-
*
|
|
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
|
|
15
|
+
* import * as pulumi from "@checkly/pulumi";
|
|
21
16
|
*
|
|
22
|
-
*
|
|
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: "
|
|
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
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
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:
|
|
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:
|
|
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
|
-
*
|
|
108
|
+
* (Default `false`)
|
|
177
109
|
*/
|
|
178
110
|
public readonly sendDegraded!: pulumi.Output<boolean | undefined>;
|
|
179
111
|
/**
|
|
180
|
-
*
|
|
112
|
+
* (Default `true`)
|
|
181
113
|
*/
|
|
182
114
|
public readonly sendFailure!: pulumi.Output<boolean | undefined>;
|
|
183
115
|
/**
|
|
184
|
-
*
|
|
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
|
-
*
|
|
122
|
+
* (Default `false`)
|
|
194
123
|
*/
|
|
195
124
|
public readonly sslExpiry!: pulumi.Output<boolean | undefined>;
|
|
196
125
|
/**
|
|
197
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
182
|
+
* (Default `false`)
|
|
259
183
|
*/
|
|
260
184
|
sendDegraded?: pulumi.Input<boolean>;
|
|
261
185
|
/**
|
|
262
|
-
*
|
|
186
|
+
* (Default `true`)
|
|
263
187
|
*/
|
|
264
188
|
sendFailure?: pulumi.Input<boolean>;
|
|
265
189
|
/**
|
|
266
|
-
*
|
|
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
|
-
*
|
|
196
|
+
* (Default `false`)
|
|
276
197
|
*/
|
|
277
198
|
sslExpiry?: pulumi.Input<boolean>;
|
|
278
199
|
/**
|
|
279
|
-
*
|
|
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
|
-
*
|
|
214
|
+
* (Default `false`)
|
|
297
215
|
*/
|
|
298
216
|
sendDegraded?: pulumi.Input<boolean>;
|
|
299
217
|
/**
|
|
300
|
-
*
|
|
218
|
+
* (Default `true`)
|
|
301
219
|
*/
|
|
302
220
|
sendFailure?: pulumi.Input<boolean>;
|
|
303
221
|
/**
|
|
304
|
-
*
|
|
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
|
-
*
|
|
228
|
+
* (Default `false`)
|
|
314
229
|
*/
|
|
315
230
|
sslExpiry?: pulumi.Input<boolean>;
|
|
316
231
|
/**
|
|
317
|
-
*
|
|
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
|
-
|
|
1
|
+
# Checkly Pulumi Provider
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
<br>
|
|
6
|
+
## Installation
|
|
15
7
|
|
|
16
|
-
|
|
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
|
|
16
|
+
npm install @checkly/pulumi
|
|
26
17
|
```
|
|
27
18
|
|
|
28
19
|
or `yarn`:
|
|
29
20
|
|
|
30
21
|
```bash
|
|
31
|
-
yarn add @pulumi
|
|
22
|
+
yarn add @checkly/pulumi
|
|
32
23
|
```
|
|
33
24
|
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
118
|
+
> Check the [examples directory](https://github.com/checkly/pulumi-checkly/tree/main/examples) for more detailed code samples.
|
|
51
119
|
|
|
52
|
-
|
|
120
|
+
## Syncing resources
|
|
53
121
|
|
|
54
|
-
|
|
55
|
-
dotnet add package Pulumi.Checkly
|
|
56
|
-
```
|
|
122
|
+
Just run the regular `pulumi up` command
|
|
57
123
|
|
|
58
|
-
<br>
|
|
59
124
|
|
|
60
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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=
|
|
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 />
|