@checkly/pulumi 1.1.4 → 2.0.0-alpha.1738251430
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/LICENSE +202 -21
- package/README.md +39 -137
- package/alertChannel.d.ts +44 -20
- package/alertChannel.js +41 -19
- package/alertChannel.js.map +1 -1
- package/check.d.ts +101 -61
- package/check.js +8 -0
- package/check.js.map +1 -1
- package/checkGroup.d.ts +56 -104
- package/checkGroup.js +8 -87
- package/checkGroup.js.map +1 -1
- package/dashboard.d.ts +29 -9
- package/dashboard.js +12 -6
- package/dashboard.js.map +1 -1
- package/environmentVariable.d.ts +5 -2
- package/environmentVariable.js +4 -2
- package/environmentVariable.js.map +1 -1
- package/getStaticIps.d.ts +50 -0
- package/getStaticIps.js +26 -0
- package/getStaticIps.js.map +1 -0
- package/heartbeatCheck.d.ts +129 -0
- package/heartbeatCheck.js +91 -0
- package/heartbeatCheck.js.map +1 -0
- package/index.d.ts +39 -11
- package/index.js +42 -50
- package/index.js.map +1 -1
- package/maintenanceWindow.d.ts +5 -4
- package/maintenanceWindow.js +5 -4
- package/maintenanceWindow.js.map +1 -1
- package/package.json +7 -7
- package/privateLocation.d.ts +2 -2
- package/privateLocation.js +4 -2
- package/privateLocation.js.map +1 -1
- package/provider.js +1 -1
- package/provider.js.map +1 -1
- package/snippet.d.ts +20 -0
- package/snippet.js +20 -0
- package/snippet.js.map +1 -1
- package/triggerCheck.d.ts +2 -2
- package/triggerCheck.js +2 -2
- package/triggerCheckGroup.d.ts +2 -2
- package/triggerCheckGroup.js +2 -2
- package/types/index.js.map +1 -1
- package/types/input.d.ts +275 -7
- package/types/input.js.map +1 -1
- package/types/output.d.ts +281 -13
- package/types/output.js.map +1 -1
- package/utilities.d.ts +4 -0
- package/utilities.js +45 -1
- package/utilities.js.map +1 -1
- package/package.json.bak +0 -29
- package/scripts/install-pulumi-plugin.js +0 -26
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,152 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
<img height="128" src="https://www.checklyhq.com/images/footer-logo.svg" align="right" />
|
|
3
|
-
<h1>Checkly Pulumi Provider</h1>
|
|
4
|
-
</p>
|
|
1
|
+
# Checkly Provider for Pulumi
|
|
5
2
|
|
|
6
3
|

|
|
7
4
|

|
|
8
5
|
|
|
9
|
-
The Checkly Pulumi
|
|
10
|
-
Note that this project is in its early stages and breaking changes could happen.
|
|
6
|
+
The Checkly provider for Pulumi can be used to provision any of the monitoring resources available in [Checkly](https://www.checklyhq.com/).
|
|
11
7
|
|
|
12
8
|
## Installation
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
2. This package is only available for JavaScript and TypeScript but support for other languages will be available soon.
|
|
10
|
+
The Checkly provider is available as a package in most Pulumi languages:
|
|
16
11
|
|
|
17
|
-
|
|
12
|
+
* JavaScript/TypeScript: [`@checkly/pulumi`](https://www.npmjs.com/package/@checkly/pulumi)
|
|
13
|
+
* Python: [`pulumi-checkly`](https://pypi.org/project/pulumi-checkly/)
|
|
14
|
+
* Go: [`github.com/checkly/pulumi-checkly/sdk/go/checkly`](https://github.com/checkly/pulumi-checkly)
|
|
15
|
+
* .NET: [`Pulumi.Checkly`](https://www.nuget.org/packages/Pulumi.Checkly)
|
|
18
16
|
|
|
19
|
-
To use from JavaScript or TypeScript in Node.js, install using either `npm` or `yarn`:
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
## Authentication
|
|
19
|
+
|
|
20
|
+
The Checkly provider must be configured with an `API Key` and an `Account ID` in order to deploy Checkly resources. Sign up for a [Checkly](https://www.checklyhq.com) account and follow our [integration guide](https://www.checklyhq.com/docs/integrations/pulumi/) to create and configure your credentials.
|
|
21
|
+
|
|
22
|
+
### Example configuration
|
|
23
|
+
|
|
24
|
+
First, configure your Checkly Account ID:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
pulumi config set checkly:accountId YOUR_CHECKLY_ACCOUNT_ID
|
|
24
28
|
```
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
Then, configure you Checkly API key (with `--secret`):
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
```
|
|
33
|
+
pulumi config set checkly:apiKey YOUR_CHECKLY_API_KEY --secret
|
|
34
|
+
```
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
You should now be able to deploy Checkly resources.
|
|
37
|
+
|
|
38
|
+
## Example usage
|
|
39
|
+
|
|
40
|
+
You can find working JavaScript and TypeScript code samples in the [`./examples`](https://github.com/checkly/pulumi-checkly/tree/main/examples) directory.
|
|
41
|
+
|
|
42
|
+
## Configuration options
|
|
43
|
+
|
|
44
|
+
The following configuration points are available for the Checkly provider:
|
|
45
|
+
|
|
46
|
+
- `checkly:accountId` (environment: `CHECKLY_ACCOUNT_ID`) - your Checkly Account ID
|
|
47
|
+
- `checkly:apiKey` (environment: `CHECKLY_API_KEY`) - your Checkly API Key
|
|
48
|
+
* If you don't have an API Key, you can create one [here](https://app.checklyhq.com/settings/user/api-keys).
|
|
49
|
+
* Make sure to use the `--secret` flag with `pulumi config set`.
|
|
50
|
+
- `checkly:apiUrl` (environment: `CHECKLY_API_URL`) - for internal development purposes only
|
|
51
|
+
|
|
52
|
+
## Reference
|
|
31
53
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
> If you don't have an `API Key`, you can create one [here](https://app.checklyhq.com/settings/user/api-keys).
|
|
35
|
-
|
|
36
|
-
Once you generated the `API Key` there are two ways to communicate your authorization tokens to Pulumi:
|
|
37
|
-
|
|
38
|
-
1. Set the environment variables `CHECKLY_API_KEY` and `CHECKLY_ACCOUNT_ID`:
|
|
39
|
-
```bash
|
|
40
|
-
$ export CHECKLY_API_KEY=cu_xxx
|
|
41
|
-
$ export CHECKLY_ACCOUNT_ID=xxx
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
2. Set them using `pulumi config` command, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access:
|
|
45
|
-
```bash
|
|
46
|
-
$ pulumi config set checkly:apiKey cu_xxx --secret
|
|
47
|
-
$ pulumi config set checkly:accountId xxx
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
> Remember to pass `--secret` when setting `checkly:apiKey` so it is properly encrypted.
|
|
51
|
-
|
|
52
|
-
## Getting Started
|
|
53
|
-
|
|
54
|
-
1. Open your terminal and run `$ pulumi new javascript` to create a new Pulumi project with the `javascript` template.
|
|
55
|
-
1. Install the Checkly Pulumi provider using npm: `$ npm i @checkly/pulumi`.
|
|
56
|
-
1. Look for `index.js` file in the root of your project and replace content with the following code:
|
|
57
|
-
|
|
58
|
-
```javascript
|
|
59
|
-
const checkly = require("@checkly/pulumi")
|
|
60
|
-
|
|
61
|
-
new checkly.Check("api-check", {
|
|
62
|
-
type: "API",
|
|
63
|
-
name: "Public SpaceX API",
|
|
64
|
-
activated: true,
|
|
65
|
-
frequency: 10,
|
|
66
|
-
locations: ["us-east-1"],
|
|
67
|
-
request: {
|
|
68
|
-
method: "GET",
|
|
69
|
-
url: "https://api.spacexdata.com/v3",
|
|
70
|
-
assertions: [
|
|
71
|
-
{
|
|
72
|
-
source: 'STATUS_CODE',
|
|
73
|
-
comparison: 'EQUALS',
|
|
74
|
-
target: 200
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
source: 'JSON_BODY',
|
|
78
|
-
property: '$.project_name',
|
|
79
|
-
comparison: 'EQUALS',
|
|
80
|
-
target: 'SpaceX-API'
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
new checkly.Check("browser-check", {
|
|
87
|
-
type: "BROWSER",
|
|
88
|
-
name: "Google.com Playwright check",
|
|
89
|
-
activated: true,
|
|
90
|
-
frequency: 10,
|
|
91
|
-
locations: ["us-east-1"],
|
|
92
|
-
script: `const { chromium } = require('playwright')
|
|
93
|
-
|
|
94
|
-
async function run () {
|
|
95
|
-
const browser = await chromium.launch()
|
|
96
|
-
const page = await browser.newPage()
|
|
97
|
-
|
|
98
|
-
const response = await page.goto('https://google.com')
|
|
99
|
-
|
|
100
|
-
if (response.status() > 399) {
|
|
101
|
-
throw new Error('Failed with response code \${response.status()}')
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
await page.screenshot({ path: 'screenshot.jpg' })
|
|
105
|
-
|
|
106
|
-
await page.close()
|
|
107
|
-
await browser.close()
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
run()`
|
|
111
|
-
})
|
|
112
|
-
```
|
|
113
|
-
1. Setup you Checkly API Key and Account id:
|
|
114
|
-
```bash
|
|
115
|
-
$ pulumi config set checkly:apiKey cu_xxx --secret
|
|
116
|
-
$ pulumi config set checkly:accountId xxx
|
|
117
|
-
```
|
|
118
|
-
1. You are ready to go, run `$ pulumi up` to deploy your stack 🚀
|
|
119
|
-
|
|
120
|
-
## Examples
|
|
121
|
-
|
|
122
|
-
Find working JavaScript and TypeScript code samples in the [`./examples`](https://github.com/checkly/pulumi-checkly/tree/main/examples) directory.
|
|
123
|
-
|
|
124
|
-
## Learn More
|
|
125
|
-
For documentation and example usage see:
|
|
126
|
-
1. [Checkly's documentation](https://www.checklyhq.com/docs/integrations/pulumi/).
|
|
127
|
-
2. [The official provider documentation](https://www.pulumi.com/registry/packages/checkly/api-docs/)
|
|
128
|
-
3. [Working Examples](https://github.com/checkly/pulumi-checkly/tree/main/examples).
|
|
129
|
-
|
|
130
|
-
## Questions
|
|
131
|
-
For questions and support please open a new [discussion](https://github.com/checkly/pulumi-checkly/discussions). The issue list of this repo is exclusively for bug reports and feature/docs requests.
|
|
132
|
-
|
|
133
|
-
## Issues
|
|
134
|
-
Please make sure to respect issue requirements and choose the proper [issue template](https://github.com/checkly/pulumi-checkly/issues/new/choose) when opening an issue. Issues not conforming to the guidelines may be closed.
|
|
135
|
-
|
|
136
|
-
## Contribution
|
|
137
|
-
Please make sure to read the [Contributing Guide](https://github.com/checkly/pulumi-checkly/blob/main/CONTRIBUTING.md) before making a pull request.
|
|
138
|
-
|
|
139
|
-
## License
|
|
140
|
-
|
|
141
|
-
[MIT](https://github.com/checkly/pulumi-checkly/blob/main/LICENSE)
|
|
142
|
-
|
|
143
|
-
<br>
|
|
144
|
-
<p align="center">
|
|
145
|
-
<a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=headless-recorder" target="_blank">
|
|
146
|
-
<img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
|
|
147
|
-
</a>
|
|
148
|
-
<br />
|
|
149
|
-
<i><sub>Delightful Active Monitoring for Developers</sub></i>
|
|
150
|
-
<br>
|
|
151
|
-
<b><sub>From Checkly with ♥️</sub></b>
|
|
152
|
-
<p>
|
|
54
|
+
For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/checkly/api-docs/).
|
package/alertChannel.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
-
import
|
|
2
|
+
import * as inputs from "./types/input";
|
|
3
|
+
import * as outputs from "./types/output";
|
|
3
4
|
/**
|
|
4
5
|
* Allows you to define alerting channels for the checks and groups in your account
|
|
5
6
|
*
|
|
@@ -7,10 +8,10 @@ import { input as inputs, output as outputs } from "./types";
|
|
|
7
8
|
*
|
|
8
9
|
* ```typescript
|
|
9
10
|
* import * as pulumi from "@pulumi/pulumi";
|
|
10
|
-
* import * as
|
|
11
|
+
* import * as checkly from "@checkly/pulumi";
|
|
11
12
|
*
|
|
12
13
|
* // An Email alert channel
|
|
13
|
-
* const emailAc = new checkly.AlertChannel("
|
|
14
|
+
* const emailAc = new checkly.AlertChannel("email_ac", {
|
|
14
15
|
* email: {
|
|
15
16
|
* address: "john@example.com",
|
|
16
17
|
* },
|
|
@@ -21,7 +22,7 @@ import { input as inputs, output as outputs } from "./types";
|
|
|
21
22
|
* sslExpiryThreshold: 22,
|
|
22
23
|
* });
|
|
23
24
|
* // A SMS alert channel
|
|
24
|
-
* const smsAc = new checkly.AlertChannel("
|
|
25
|
+
* const smsAc = new checkly.AlertChannel("sms_ac", {
|
|
25
26
|
* sms: {
|
|
26
27
|
* name: "john",
|
|
27
28
|
* number: "+5491100001111",
|
|
@@ -30,42 +31,62 @@ import { input as inputs, output as outputs } from "./types";
|
|
|
30
31
|
* sendFailure: true,
|
|
31
32
|
* });
|
|
32
33
|
* // A Slack alert channel
|
|
33
|
-
* const slackAc = new checkly.AlertChannel("
|
|
34
|
+
* const slackAc = new checkly.AlertChannel("slack_ac", {slack: {
|
|
34
35
|
* channel: "#checkly-notifications",
|
|
35
36
|
* url: "https://hooks.slack.com/services/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",
|
|
36
37
|
* }});
|
|
37
38
|
* // An Opsgenie alert channel
|
|
38
|
-
* const opsgenieAc = new checkly.AlertChannel("
|
|
39
|
+
* const opsgenieAc = new checkly.AlertChannel("opsgenie_ac", {opsgenie: {
|
|
39
40
|
* name: "opsalerts",
|
|
40
41
|
* apiKey: "fookey",
|
|
41
42
|
* region: "fooregion",
|
|
42
43
|
* priority: "foopriority",
|
|
43
44
|
* }});
|
|
44
|
-
* //
|
|
45
|
-
* const pagerdutyAc = new checkly.AlertChannel("
|
|
45
|
+
* // A Pagerduty alert channel
|
|
46
|
+
* const pagerdutyAc = new checkly.AlertChannel("pagerduty_ac", {pagerduty: {
|
|
46
47
|
* account: "checkly",
|
|
47
48
|
* serviceKey: "key1",
|
|
48
49
|
* serviceName: "pdalert",
|
|
49
50
|
* }});
|
|
50
|
-
* //
|
|
51
|
-
* const webhookAc = new checkly.AlertChannel("
|
|
51
|
+
* // A Webhook alert channel
|
|
52
|
+
* const webhookAc = new checkly.AlertChannel("webhook_ac", {webhook: {
|
|
52
53
|
* name: "foo",
|
|
53
54
|
* method: "get",
|
|
54
55
|
* template: "footemplate",
|
|
55
56
|
* url: "https://example.com/foo",
|
|
56
57
|
* webhookSecret: "foosecret",
|
|
57
58
|
* }});
|
|
59
|
+
* // A Firehydran alert channel integration
|
|
60
|
+
* const firehydrantAc = new checkly.AlertChannel("firehydrant_ac", {webhook: {
|
|
61
|
+
* name: "firehydrant",
|
|
62
|
+
* method: "post",
|
|
63
|
+
* template: `{
|
|
64
|
+
* "event": "{{ALERT_TITLE}}",
|
|
65
|
+
* "link": "{{RESULT_LINK}}",
|
|
66
|
+
* "check_id": "{{CHECK_ID}}",
|
|
67
|
+
* "check_type": "{{CHECK_TYPE}}",
|
|
68
|
+
* "alert_type": "{{ALERT_TYPE}}",
|
|
69
|
+
* "started_at": "{{STARTED_AT}}",
|
|
70
|
+
* "check_result_id": "{{CHECK_RESULT_ID}}"
|
|
71
|
+
* },
|
|
72
|
+
* `,
|
|
73
|
+
* url: "https://app.firehydrant.io/integrations/alerting/webhooks/2/checkly",
|
|
74
|
+
* webhookType: "WEBHOOK_FIREHYDRANT",
|
|
75
|
+
* }});
|
|
58
76
|
* // Connecting the alert channel to a check
|
|
59
|
-
* const exampleCheck = new checkly.Check("
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
77
|
+
* const exampleCheck = new checkly.Check("example_check", {
|
|
78
|
+
* name: "Example check",
|
|
79
|
+
* alertChannelSubscriptions: [
|
|
80
|
+
* {
|
|
81
|
+
* channelId: emailAc.id,
|
|
82
|
+
* activated: true,
|
|
83
|
+
* },
|
|
84
|
+
* {
|
|
85
|
+
* channelId: smsAc.id,
|
|
86
|
+
* activated: true,
|
|
87
|
+
* },
|
|
88
|
+
* ],
|
|
89
|
+
* });
|
|
69
90
|
* ```
|
|
70
91
|
*/
|
|
71
92
|
export declare class AlertChannel extends pulumi.CustomResource {
|
|
@@ -84,6 +105,7 @@ export declare class AlertChannel extends pulumi.CustomResource {
|
|
|
84
105
|
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
85
106
|
*/
|
|
86
107
|
static isInstance(obj: any): obj is AlertChannel;
|
|
108
|
+
readonly call: pulumi.Output<outputs.AlertChannelCall | undefined>;
|
|
87
109
|
readonly email: pulumi.Output<outputs.AlertChannelEmail | undefined>;
|
|
88
110
|
readonly opsgenie: pulumi.Output<outputs.AlertChannelOpsgenie | undefined>;
|
|
89
111
|
readonly pagerduty: pulumi.Output<outputs.AlertChannelPagerduty | undefined>;
|
|
@@ -123,6 +145,7 @@ export declare class AlertChannel extends pulumi.CustomResource {
|
|
|
123
145
|
* Input properties used for looking up and filtering AlertChannel resources.
|
|
124
146
|
*/
|
|
125
147
|
export interface AlertChannelState {
|
|
148
|
+
call?: pulumi.Input<inputs.AlertChannelCall>;
|
|
126
149
|
email?: pulumi.Input<inputs.AlertChannelEmail>;
|
|
127
150
|
opsgenie?: pulumi.Input<inputs.AlertChannelOpsgenie>;
|
|
128
151
|
pagerduty?: pulumi.Input<inputs.AlertChannelPagerduty>;
|
|
@@ -154,6 +177,7 @@ export interface AlertChannelState {
|
|
|
154
177
|
* The set of arguments for constructing a AlertChannel resource.
|
|
155
178
|
*/
|
|
156
179
|
export interface AlertChannelArgs {
|
|
180
|
+
call?: pulumi.Input<inputs.AlertChannelCall>;
|
|
157
181
|
email?: pulumi.Input<inputs.AlertChannelEmail>;
|
|
158
182
|
opsgenie?: pulumi.Input<inputs.AlertChannelOpsgenie>;
|
|
159
183
|
pagerduty?: pulumi.Input<inputs.AlertChannelPagerduty>;
|
package/alertChannel.js
CHANGED
|
@@ -12,10 +12,10 @@ const utilities = require("./utilities");
|
|
|
12
12
|
*
|
|
13
13
|
* ```typescript
|
|
14
14
|
* import * as pulumi from "@pulumi/pulumi";
|
|
15
|
-
* import * as
|
|
15
|
+
* import * as checkly from "@checkly/pulumi";
|
|
16
16
|
*
|
|
17
17
|
* // An Email alert channel
|
|
18
|
-
* const emailAc = new checkly.AlertChannel("
|
|
18
|
+
* const emailAc = new checkly.AlertChannel("email_ac", {
|
|
19
19
|
* email: {
|
|
20
20
|
* address: "john@example.com",
|
|
21
21
|
* },
|
|
@@ -26,7 +26,7 @@ const utilities = require("./utilities");
|
|
|
26
26
|
* sslExpiryThreshold: 22,
|
|
27
27
|
* });
|
|
28
28
|
* // A SMS alert channel
|
|
29
|
-
* const smsAc = new checkly.AlertChannel("
|
|
29
|
+
* const smsAc = new checkly.AlertChannel("sms_ac", {
|
|
30
30
|
* sms: {
|
|
31
31
|
* name: "john",
|
|
32
32
|
* number: "+5491100001111",
|
|
@@ -35,42 +35,62 @@ const utilities = require("./utilities");
|
|
|
35
35
|
* sendFailure: true,
|
|
36
36
|
* });
|
|
37
37
|
* // A Slack alert channel
|
|
38
|
-
* const slackAc = new checkly.AlertChannel("
|
|
38
|
+
* const slackAc = new checkly.AlertChannel("slack_ac", {slack: {
|
|
39
39
|
* channel: "#checkly-notifications",
|
|
40
40
|
* url: "https://hooks.slack.com/services/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",
|
|
41
41
|
* }});
|
|
42
42
|
* // An Opsgenie alert channel
|
|
43
|
-
* const opsgenieAc = new checkly.AlertChannel("
|
|
43
|
+
* const opsgenieAc = new checkly.AlertChannel("opsgenie_ac", {opsgenie: {
|
|
44
44
|
* name: "opsalerts",
|
|
45
45
|
* apiKey: "fookey",
|
|
46
46
|
* region: "fooregion",
|
|
47
47
|
* priority: "foopriority",
|
|
48
48
|
* }});
|
|
49
|
-
* //
|
|
50
|
-
* const pagerdutyAc = new checkly.AlertChannel("
|
|
49
|
+
* // A Pagerduty alert channel
|
|
50
|
+
* const pagerdutyAc = new checkly.AlertChannel("pagerduty_ac", {pagerduty: {
|
|
51
51
|
* account: "checkly",
|
|
52
52
|
* serviceKey: "key1",
|
|
53
53
|
* serviceName: "pdalert",
|
|
54
54
|
* }});
|
|
55
|
-
* //
|
|
56
|
-
* const webhookAc = new checkly.AlertChannel("
|
|
55
|
+
* // A Webhook alert channel
|
|
56
|
+
* const webhookAc = new checkly.AlertChannel("webhook_ac", {webhook: {
|
|
57
57
|
* name: "foo",
|
|
58
58
|
* method: "get",
|
|
59
59
|
* template: "footemplate",
|
|
60
60
|
* url: "https://example.com/foo",
|
|
61
61
|
* webhookSecret: "foosecret",
|
|
62
62
|
* }});
|
|
63
|
+
* // A Firehydran alert channel integration
|
|
64
|
+
* const firehydrantAc = new checkly.AlertChannel("firehydrant_ac", {webhook: {
|
|
65
|
+
* name: "firehydrant",
|
|
66
|
+
* method: "post",
|
|
67
|
+
* template: `{
|
|
68
|
+
* "event": "{{ALERT_TITLE}}",
|
|
69
|
+
* "link": "{{RESULT_LINK}}",
|
|
70
|
+
* "check_id": "{{CHECK_ID}}",
|
|
71
|
+
* "check_type": "{{CHECK_TYPE}}",
|
|
72
|
+
* "alert_type": "{{ALERT_TYPE}}",
|
|
73
|
+
* "started_at": "{{STARTED_AT}}",
|
|
74
|
+
* "check_result_id": "{{CHECK_RESULT_ID}}"
|
|
75
|
+
* },
|
|
76
|
+
* `,
|
|
77
|
+
* url: "https://app.firehydrant.io/integrations/alerting/webhooks/2/checkly",
|
|
78
|
+
* webhookType: "WEBHOOK_FIREHYDRANT",
|
|
79
|
+
* }});
|
|
63
80
|
* // Connecting the alert channel to a check
|
|
64
|
-
* const exampleCheck = new checkly.Check("
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
81
|
+
* const exampleCheck = new checkly.Check("example_check", {
|
|
82
|
+
* name: "Example check",
|
|
83
|
+
* alertChannelSubscriptions: [
|
|
84
|
+
* {
|
|
85
|
+
* channelId: emailAc.id,
|
|
86
|
+
* activated: true,
|
|
87
|
+
* },
|
|
88
|
+
* {
|
|
89
|
+
* channelId: smsAc.id,
|
|
90
|
+
* activated: true,
|
|
91
|
+
* },
|
|
92
|
+
* ],
|
|
93
|
+
* });
|
|
74
94
|
* ```
|
|
75
95
|
*/
|
|
76
96
|
class AlertChannel extends pulumi.CustomResource {
|
|
@@ -101,6 +121,7 @@ class AlertChannel extends pulumi.CustomResource {
|
|
|
101
121
|
opts = opts || {};
|
|
102
122
|
if (opts.id) {
|
|
103
123
|
const state = argsOrState;
|
|
124
|
+
resourceInputs["call"] = state ? state.call : undefined;
|
|
104
125
|
resourceInputs["email"] = state ? state.email : undefined;
|
|
105
126
|
resourceInputs["opsgenie"] = state ? state.opsgenie : undefined;
|
|
106
127
|
resourceInputs["pagerduty"] = state ? state.pagerduty : undefined;
|
|
@@ -115,6 +136,7 @@ class AlertChannel extends pulumi.CustomResource {
|
|
|
115
136
|
}
|
|
116
137
|
else {
|
|
117
138
|
const args = argsOrState;
|
|
139
|
+
resourceInputs["call"] = args ? args.call : undefined;
|
|
118
140
|
resourceInputs["email"] = args ? args.email : undefined;
|
|
119
141
|
resourceInputs["opsgenie"] = args ? args.opsgenie : undefined;
|
|
120
142
|
resourceInputs["pagerduty"] = args ? args.pagerduty : undefined;
|