Skip to main content

Checkly Pulumi Provider

Contributor Covenant GitHub tag (latest by date)

The Checkly Pulumi provider enables you to create and configure Checkly resources using your favourite programming language. Note that this project is in its early stages and breaking changes could happen.

Installation

  1. To use this package, please install the Pulumi CLI first.
  2. This package is only available for JavaScript and TypeScript but support for other languages will be available soon.

Node.js (JavaScript/TypeScript)

To use from JavaScript or TypeScript in Node.js, install using either npm or yarn:

$ npm install @checkly/pulumi
$ yarn add @checkly/pulumi

Python, Go & .NET

TBA

Authentication

The Pulumi Checkly Provider needs to be configured with a Checkly API Key and Account ID before it can be used to create resources.

If you don't have an API Key, you can create one here.

Once you generated the API Key there are two ways to communicate your authorization tokens to Pulumi:

  1. Set the environment variables CHECKLY_API_KEY and CHECKLY_ACCOUNT_ID:

    $ export CHECKLY_API_KEY=cu_xxx
    $ export CHECKLY_ACCOUNT_ID=xxx
    
  2. Set them using pulumi config command, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access:

    $ pulumi config set checkly:apiKey cu_xxx --secret
    $ pulumi config set checkly:accountId xxx
    

Remember to pass --secret when setting checkly:apiKey so it is properly encrypted.

Getting Started

  1. Open your terminal and run $ pulumi new to create a new Pulumi project, chose the javascript template and the target stack.

  2. Install the Checkly Pulumi provider using npm: $ npm i @checkly/pulumi.

  3. Look for index.js file in the root of your project and replace content with the following code:

    const checkly = require("@checkly/pulumi")
    
    new checkly.Check("api-check", {
      type: "API",
      name: "Public SpaceX API",
      activated: true,
      frequency: 10,
      locations: ["us-east-1"],
      request: {
        method: "GET",
        url: "https://api.spacexdata.com/v3",
        assertions: [
          {
            source: 'STATUS_CODE',
            comparison: 'EQUALS',
            target: 200
          },
          {
            source: 'JSON_BODY',
            property: '$.project_name',
            comparison: 'EQUALS',
            target: 'SpaceX-API'
          }
        ]
      }
    })
    
    new checkly.Check("browser-check", {
      type: "BROWSER",
      name: "Google.com Playwright check",
      activated: true,
      frequency: 10,
      locations: ["us-east-1"],
      script: `const { chromium } = require('playwright')
    
    async function run () {
      const browser = await chromium.launch()
      const page = await browser.newPage()
    
      const response = await page.goto('https://google.com')
    
      if (response.status() > 399) {
        throw new Error('Failed with response code \${response.status()}')
      }
    
      await page.screenshot({ path: 'screenshot.jpg' })
    
      await page.close()
      await browser.close()
    }
    
    run()`
    })
    
  4. Setup you Checkly API Key and Account id:

    $ pulumi config set checkly:apiKey cu_xxx --secret
    $ pulumi config set checkly:accountId xxx
    
  5. You are ready to go, run $ pulumi up to deploy your stack 🚀

Check the examples directory for more detailed code samples.

Learn More

For documentation and example usage see:

  1. Checkly's documentation.
  2. The official provider documentation
  3. Working Examples.

Questions

For questions and support please open a new discussion. The issue list of this repo is exclusively for bug reports and feature/docs requests.

Issues

Please make sure to respect issue requirements and choose the proper issue template when opening an issue. Issues not conforming to the guidelines may be closed.

Contribution

Please make sure to read the Contributing Guide before making a pull request.

License

MIT


Checkly
Delightful Active Monitoring for Developers
From Checkly with ♥️

Metadata

Release files for pulumi-checkly 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulumi-checkly 1.0.1
File Size Uploaded
pulumi_checkly-1.0.1.tar.gz 35.0 kB Details

Release files / pulumi_checkly-1.0.1.tar.gz

Download URL pulumi_checkly-1.0.1.tar.gz
Size 35.0 kB
Tags Source
SHA-256 checksum
How to use checksums
507565af01d86b2d908cb78da1c4188debd8eb75a6a6ef35ff50201e4e8e0811
BLAKE2b-256 checksum
How to use checksums
a779f33c7ede578b71596e0e25f5afb31f3a31c1977a3f0de7b9489180b19b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

2.13.0

2 release files

2.11.0

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.3

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

This release

1.0.1 This release

1 release file

1.0.0

1 release file

0.0.5

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page