@checkly/pulumi 0.0.2 → 0.0.5

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 (2) hide show
  1. package/README.md +75 -81
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  </p>
5
5
 
6
6
  ![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)
7
+ ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/checkly/pulumi-checkly?label=Version)
7
8
 
8
9
  The Checkly Pulumi provider enables you to create and configure Checkly resources using your favourite programming language.
9
10
  Note that this project is in its early stages and breaking changes could happen.
@@ -15,22 +16,11 @@ Note that this project is in its early stages and breaking changes could happen.
15
16
 
16
17
  ### Node.js (JavaScript/TypeScript)
17
18
 
18
- To use from JavaScript or TypeScript in Node.js, install using either `npm`:
19
+ To use from JavaScript or TypeScript in Node.js, install using either `npm` or `yarn`:
19
20
 
20
21
  ```bash
21
- npm install @checkly/pulumi
22
- ```
23
-
24
- or `yarn`:
25
-
26
- ```bash
27
- yarn add @checkly/pulumi
28
- ```
29
-
30
- Install the provider binary plugin. This is only needed due to an outstanding bug in with Pulumi registry
31
-
32
- ```bash
33
- pulumi plugin install resource checkly v0.0.1-alpha.9 --server https://github.com/checkly/pulumi-checkly/releases/download/v0.0.1-alpha.9
22
+ $ npm install @checkly/pulumi
23
+ $ yarn add @checkly/pulumi
34
24
  ```
35
25
 
36
26
  ### Python, Go & .NET
@@ -59,94 +49,98 @@ Once you generated the `API Key` there are two ways to communicate your authoriz
59
49
 
60
50
  > Remember to pass `--secret` when setting `checkly:apiKey` so it is properly encrypted.
61
51
 
62
- ## Creating Resources
63
-
64
- The example below shows a basic API check and Browser check.
65
-
66
- ```javascript
67
- // index.js
68
- const checkly = require("@checkly/pulumi")
69
-
70
- new checkly.Check("api-check", {
71
- type: "API",
72
- name: "Public SpaceX API",
73
- activated: true,
74
- frequency: 10,
75
- locations: ["us-east-1"],
76
- request: {
77
- method: "GET",
78
- url: "https://api.spacexdata.com/v3",
79
- assertions: [
80
- {
81
- source: 'STATUS_CODE',
82
- comparison: 'EQUALS',
83
- target: 200
84
- },
85
- {
86
- source: 'JSON_BODY',
87
- property: '$.project_name',
88
- comparison: 'EQUALS',
89
- target: 'SpaceX-API'
52
+ ## Getting Started
53
+
54
+ 1. Open your terminal and run `$ pulumi new` to create a new Pulumi project, chose the `javascript` template and the target stack.
55
+ 1. Install the Checkly Pulumi provider using npm: `$ npm i @checkly/pulumi`.
56
+ 1. Create an `index.js` file in the root of your project and paste 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
+ ]
90
83
  }
91
- ]
92
- }
93
- })
84
+ })
94
85
 
95
- new checkly.Check("browser-check", {
96
- type: "BROWSER",
97
- name: "Google.com Playwright check",
98
- activated: true,
99
- frequency: 10,
100
- locations: ["us-east-1"],
101
- script: `const { chromium } = require('playwright')
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')
102
93
 
103
- async function run () {
104
- const browser = await chromium.launch()
105
- const page = await browser.newPage()
94
+ async function run () {
95
+ const browser = await chromium.launch()
96
+ const page = await browser.newPage()
106
97
 
107
- const response = await page.goto('https://google.com')
98
+ const response = await page.goto('https://google.com')
108
99
 
109
- if (response.status() > 399) {
110
- throw new Error('Failed with response code \${response.status()}')
111
- }
100
+ if (response.status() > 399) {
101
+ throw new Error('Failed with response code \${response.status()}')
102
+ }
112
103
 
113
- await page.screenshot({ path: 'screenshot.jpg' })
104
+ await page.screenshot({ path: 'screenshot.jpg' })
114
105
 
115
- await page.close()
116
- await browser.close()
117
- }
106
+ await page.close()
107
+ await browser.close()
108
+ }
118
109
 
119
- run()`
120
- })
121
- ```
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 🚀
122
119
 
123
120
  > Check the [examples directory](https://github.com/checkly/pulumi-checkly/tree/main/examples) for more detailed code samples.
124
121
 
125
- ## Syncing resources
126
-
127
- Just run the regular `pulumi up` command
122
+ ## Learn More
123
+ For documentation and example usage see:
124
+ 1. [Checkly's documentation](https://www.checklyhq.com/docs/integrations/pulumi/).
125
+ 2. [The official provider documentation](https://www.pulumi.com/registry/packages/checkly/api-docs/)
126
+ 3. [Working Examples](https://github.com/checkly/pulumi-checkly/examples).
128
127
 
128
+ ## Questions
129
+ 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.
129
130
 
130
- ## Configuration
131
+ ## Issues
132
+ 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.
131
133
 
132
- The following configuration points are available for the `foo` provider:
133
-
134
- - `checkly:apiKey` (environment: `CHECKLY_API_KEY`) - the Checkly API Key.
135
- - `checkly:accountId` (environment: `CHECKLY_ACCOUNT_ID`) - the Checkly account ID.
136
-
137
- ## Reference
138
-
139
- For detailed reference documentation, please visit [the Pulumi registry](https://www.pulumi.com/registry/packages/checkly/api-docs/).
134
+ ## Contribution
135
+ Please make sure to read the [Contributing Guide](https://github.com/checkly/pulumi-checkly/blob/main/CONTRIBUTING.md) before making a pull request.
140
136
 
141
137
  ## License
142
138
 
143
139
  [MIT](https://github.com/checkly/pulumi-checkly/blob/main/LICENSE)
144
140
 
145
141
  <br>
146
-
147
-
148
142
  <p align="center">
149
- <a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=pulumi-checkly" target="_blank">
143
+ <a href="https://checklyhq.com?utm_source=github&utm_medium=sponsor-logo-github&utm_campaign=headless-recorder" target="_blank">
150
144
  <img width="100px" src="https://www.checklyhq.com/images/text_racoon_logo.svg" alt="Checkly" />
151
145
  </a>
152
146
  <br />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkly/pulumi",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "A Pulumi package for creating and managing Checkly monitoring resources.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -12,7 +12,7 @@
12
12
  "license": "MIT",
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "install": "node scripts/install-pulumi-plugin.js resource checkly 0.0.2"
15
+ "install": "node scripts/install-pulumi-plugin.js resource checkly 0.0.5"
16
16
  },
17
17
  "dependencies": {
18
18
  "@pulumi/pulumi": "^3.0.0"
@@ -24,6 +24,6 @@
24
24
  },
25
25
  "pulumi": {
26
26
  "resource": true,
27
- "pluginDownloadURL": "https://github.com/checkly/pulumi-checkly/releases/download/v0.0.2"
27
+ "pluginDownloadURL": "https://github.com/checkly/pulumi-checkly/releases/download/v0.0.5"
28
28
  }
29
29
  }