Skip to main content
The Checkly Pulumi provider enables declaring your monitoring setup as code using Pulumi.

Getting started

Learn how to create, configure and sync your checks by following this getting started guide.

Pulumi CLI setup

Before getting started and writing your monitoring setup in code, you have to set up Pulumi and its CLI. Create a new Pulumi account and install the Pulumi CLI. The pulumi command should then be available in your environment.
Create and copy a new personal access token in your Pulumi account at app.pulumi.com/account/tokens. Pulumi access token configuration screen showing a newly created token Run pulumi login and provide the token.
The CLI’s whoiam command should return your username after a successful login.
Now you’re ready to create a new Pulumi project and start setting up your Checkly infrastructure.

Create a new Pulumi project

Create a new directory for your Pulumi project and navigate into it.
Initialize a new Pulumi project with pulumi new and choose the minimal JavaScript template (javascript).
Inspect the created files by running ls and make sure that a Pulumi.yaml, package.json and index.js file are available.

Define your Checkly account ID and API key

To interact with the underlying Checkly API, provide your Checkly account ID and API key by defining those in your environment. Your account ID is accessible at app.checklyhq.com/settings/account/general. Checkly account settings showing the account ID
Create a new API key at app.checklyhq.com/settings/user/api-keys. Checkly api key section showing a newly created API key
Test that both values are available in your environment.
If you prefer storing your configuration alongside your Pulumi stack for easy multi-user access, use pulumi config set.

Install the Checkly Pulumi Provider

Install the Checkly Pulumi provider (@checkly/pulumi) with yarn or npm to integrate it in your new project.
Open index.js and require it on top of the file.
The exported checkly object provides resources such as AlertChannel, Check, and CheckGroup, enabling you to define and configure your entire Checkly monitoring setup in code. Add the following Check definition examples to the index.js.

Examples

How to create your first API check

How to create your first Browser check

browser-check.js

Creating checks and applying changes

Your index.js file should now include instructions to create one API and one Browser check. Initialize a deployment and apply your changes by running pulumi up.
Congratulations! Head to the Checkly dashboard to see the newly created checks. Checkly dashboard showing created checks
Checkly resources should be managed either through Pulumi or the Checkly UI, not both. Modifying Pulumi-managed resources via the UI, and vice-versa, is likely to cause issues.

Additional resources

Find more documentation on how to create groups, alerts and snippets online.