Package: pulumi-checkly
Checkly Pulumi ProviderThe 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.InstallationTo use this package, pleaseinstall the Pulumi CLI first.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 eithernpmoryarn:$npminstall@checkly/pulumi
$yarnadd@checkly/pulumiPython, Go & .NETTBAAuthenticationThe Pulumi Checkly Provider needs to be configured with a ChecklyAPI KeyandAccount IDbefore it can be used to create resources.If you don't have anAPI Key, you can create onehere.Once you generated theAPI Keythere are two ways to communicate your authorization tokens to Pulumi:Set the environment variablesCHECKLY_API_KEYandCHECKLY_ACCOUNT_ID:$exportCHECKLY_API_KEY=cu_xxx
$exportCHECKLY_ACCOUNT_ID=xxxSet them usingpulumi configcommand, if you prefer that they be stored alongside your Pulumi stack for easy multi-user access:$pulumiconfigsetcheckly:apiKeycu_xxx--secret
$pulumiconfigsetcheckly:accountIdxxxRemember to pass--secretwhen settingcheckly:apiKeyso it is properly encrypted.Getting StartedOpen your terminal and run$ pulumi new javascriptto create a new Pulumi project with thejavascripttemplate.Install the Checkly Pulumi provider using npm:$ npm i @checkly/pulumi.Look forindex.jsfile in the root of your project and replace content with the following code:constcheckly=require("@checkly/pulumi")newcheckly.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'}]}})newcheckly.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()`})Setup you Checkly API Key and Account id:$pulumiconfigsetcheckly:apiKeycu_xxx--secret
$pulumiconfigsetcheckly:accountIdxxxYou are ready to go, run$ pulumi upto deploy your stack 🚀ExamplesFind working JavaScript and TypeScript code samples in the./examplesdirectory.Learn MoreFor documentation and example usage see:Checkly's documentation.The official provider documentationWorking Examples.QuestionsFor questions and support please open a newdiscussion. The issue list of this repo is exclusively for bug reports and feature/docs requests.IssuesPlease make sure to respect issue requirements and choose the properissue templatewhen opening an issue. Issues not conforming to the guidelines may be closed.ContributionPlease make sure to read theContributing Guidebefore making a pull request.LicenseMITDelightful Active Monitoring for DevelopersFrom Checkly with ♥️