Prerequisites
Before starting, ensure you have:- Node.js (version 14 or higher)
- Git for version control
- Checkly account with API access
- Pulumi account (free tier available)
Step 1: Install Pulumi CLI
1
Choose Installation Method
Select your preferred installation method based on your operating system and package manager
2
Install Pulumi
Run the appropriate installation command for your system
3
Verify Installation
Confirm Pulumi CLI is working correctly
Installation Options
Verify Installation
verify-installation
Step 2: Pulumi Account Setup
Create Account
- Visit app.pulumi.com/signup
- Sign up with your preferred method (GitHub, GitLab, etc.)
- Complete the account verification process
Generate Access Token
- Navigate to app.pulumi.com/account/tokens
- Click “Create token”
- Give your token a descriptive name (e.g., “Checkly Integration”)
- Copy the generated token (you won’t be able to see it again)
Login to Pulumi
login-pulumi
verify-login
Step 3: Checkly API Configuration
Get Your Account ID
- Log into app.checklyhq.com
- Navigate to Settings → Account → General
- Copy your Account ID
Create API Key
- Go to Settings → User → API Keys
- Click “Create API Key”
- Give it a descriptive name (e.g., “Pulumi Integration”)
- Copy the generated API key (starts with
cu_)
Step 4: Project Setup
Create Project Directory
create-project
Initialize Pulumi Project
init-pulumi-project
- Project name:
my-checkly-monitoring(or your preferred name) - Project description:
Checkly monitoring infrastructure as code - Stack name:
dev(or your preferred environment name)
Install Checkly Provider
Step 5: Configure Authentication
Option 1: Environment Variables (Recommended for Development)
Add to your shell profile (.bashrc, .zshrc, etc.):
setup-env-vars
reload-shell
Option 2: Pulumi Configuration (Recommended for Teams)
setup-pulumi-config
Verify Configuration
Test that your credentials are accessible:verify-env-vars
check-pulumi-config
Step 6: Create Your First Check
Update index.js
Replace the contents ofindex.js with:
index.js
Step 7: Deploy Your Infrastructure
Preview Changes
preview-changes
Deploy
deploy-infrastructure
yes to confirm the deployment.
Congratulations! You’ve successfully set up Pulumi with Checkly and deployed your first monitoring check.
Step 8: Verify Deployment
- Visit your Checkly dashboard
- Navigate to Checks
- You should see your new “Hello World API” check
- The check should be running and showing as “Passing”
Next Steps
Examples
Explore more complex examples and configurations
Best Practices
Learn best practices for managing monitoring as code
CI/CD Integration
Set up automated deployments in your CI/CD pipeline
Troubleshooting
Common issues and solutions
Troubleshooting
Common Issues
Authentication Errors
Authentication Errors
If you see authentication errors, verify:
- Your Checkly API key is correct and active
- Your account ID is correct
- Environment variables are properly set
- You’re logged into Pulumi (
pulumi whoami)
Provider Not Found
Provider Not Found
If the Checkly provider isn’t found:
- Ensure you’ve installed
@checkly/pulumi - Check your
package.jsonfor the dependency - Run
npm installoryarn install
Permission Denied
Permission Denied
If you get permission errors:
- Verify your API key has the necessary permissions
- Check that your account ID is correct
- Ensure you’re using the right Checkly account