Terminal
/api/books endpoint.
Let your agent do it
Let your agent do it
To run this guide from your terminal or your coding agent, run For this guide, the agent proves the setup with
npx checkly init in your project first. It installs the Checkly CLI and Checkly Skills for your agent. Then paste the prompt below into Claude Code, Cursor, Codex, or any agent that supports skills. It builds the same setup as this guide, proves it with npx checkly test --record, and stops for your confirmation before npx checkly deploy.Prompt
npx playwright test and terraform plan, and stops before terraform apply. The steps below are what it does, in the open.Step 1: Configure the provider
Start in an empty folder. The provider needs a Checkly user API key and the ID of the account to create resources in. Declare both as variables so they never land in a file you commit.providers.tf
TF_VAR_. The Terraform provider overview shows where to find both values in the app.
Terminal
Terminal
Step 2: Decide who hears about failures
A check that fails without telling anyone is a dashboard, not monitoring. Create the alert channel first, so everything after it can subscribe.alerts.tf
export TF_VAR_alert_email="you@yourcompany.com". Email is the simplest channel to start with. The same resource takes Slack, PagerDuty, Opsgenie, SMS, and webhook blocks; see alert channels for Terraform.
Step 3: Put shared settings in one group
Every check for the shop should run from the same places, retry the same way, and alert the same people. Declare that once on a group instead of repeating it on every check.group.tf
checkly_check_group_v2 changes nothing about its checks unless you ask it to. Each enforce_ block you add takes that setting away from the checks and applies the group’s value instead. Here the group runs every check from N. Virginia and Ireland in parallel, retries a failed run up to twice from a different region, and emails you as soon as one run still fails after its retries.
The SHOP_URL variable reaches every Browser Check in the group. Point the whole stack at a staging shop with terraform plan -var="shop_url=<your staging URL>", without touching a check.
Step 4: Monitor the shop’s flows with Browser Checks
Keep each flow in its own Playwright spec file. The file is the check’s script, and you can run it locally before Terraform ever sees it.Terminal
Terminal
for_each over a map creates one Browser Check per entry, and file() reads the spec as the check’s script:
browser.tf
Step 5: Assert on the product API
The storefront renders whatever/api/books returns. If the API answers 200 with an empty list, the pages load and show nothing to buy. An API check catches that every minute, without starting a browser.
api.tf
Step 6: Plan, then apply
Check the formatting and the configuration, then ask Terraform what it would create:Terminal
Terminal
terraform apply and type yes to create the checks in your account. From then on, the folder is the source of truth. Change a file, run terraform plan to see the difference, and apply.
Verify it works
Break a check before it reaches production. Inscripts/search.spec.ts, change 'Baiting for Robot' to 'Waiting for Robot' and run the specs again:
Terminal
Terminal
terraform apply changes a check. Once the checks exist, the same edit shows up in terraform plan as a change to that check’s script, so a reviewer sees the monitoring change next to the code change. Put 'Baiting for Robot' back.
Next
Run checks on every deploy:terraform apply keeps your monitoring in step with your code. Run the checks against each deploy too, so a broken release fails before it reaches the schedule.