atatus_http_check resource manages HTTP/API synthetic monitoring checks in Atatus.
Use this resource to monitor website availability, API response times, HTTP status codes, response headers, and response body content from configured testing locations. The resource supports creating, updating, and deleting synthetic HTTP checks through Terraform.
Dashboard guide: HTTP check. Provider setup and authentication: Terraform overview. Registry reference: atatus_http_check.
Example Usage
Production API Healthcheck with Multiple Assertions
Bulk Monitors Creation using for_each
The Atatus Terraform provider supports creating multiple HTTP checks simultaneously using Terraform’s for_each meta-argument. This allows you to monitor multiple websites by defining their URLs in a single local map instead of creating separate resources for each website.
Example Configuration
The following example creates HTTP checks for 20 websites with the same monitoring configuration.Argument Reference
Required Arguments
-
name- (String) The name of the synthetic check as displayed in the Atatus dashboard. -
url- (String) The fully qualified URL endpoint to monitor (e.g.https://api.example.com/v1/ping). -
method- (String) HTTP request method (GET,POST,PUT,DELETE,PATCH,HEAD,OPTIONS). Default:"GET". -
tags- (List of Strings) List of metadata tags to group and filter monitors in the dashboard (e.g.["env:production", "service:api"]).
Assertion Block Reference
assertion- (List of Objects) Rules used to determine whether a check test passes or fails.
assertion object supports the following attributes.
HTTP Assertions Matrix
🌍 Supported Location Codes Reference
locations- (List of Strings) Array of global region codes where the check is executed from. Default:["US_NEW_YORK"].
locations attribute of any synthetic check, use the following region codes.
Common Settings Reference (Applicable to all check types)
-
run_type- (String) Execution strategy across selected testing locations ("parallel"or"sequential"). Default:"parallel". When set to"sequential", locations run in sequence andmin_location_failedcannot be configured. -
frequency- (String) Execution frequency interval ("1m","5m","10m","15m","30m","1h","6h","12h","1d"). Default:"5m". -
retry_count- (Number) Number of automatic retries before triggering an alert upon check failure (0to3). Supported for both"parallel"and"sequential"runs. Default:0. -
min_location_failed- (Number) Minimum number of locations that must fail before triggering an incident (default:1). Note: Only applicable whenrun_typeis"parallel". Configuringmin_location_failedwhenrun_type = "sequential"is not allowed and produces a validation error. -
emails- (List of Strings) List of notification email addresses to alert when the check fails. Emails are automatically mapped to configured Atatus notification channels. -
channel_ids- (List of Strings) List of specific Atatus notification channel IDs (e.g. Slack, PagerDuty, Webhook channels). See Notification channels.