---
title: "TERRAFORM PROVIDER (PREVIEW)"
slug: "terraform-provider"
updated: 2026-05-14T17:40:19Z
published: 2026-05-14T17:40:19Z
canonical: "docs.catchpoint.com/terraform-provider"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TERRAFORM PROVIDER

## **Introduction**

Terraform is a popular Infrastructure-as-Code tool that can be used to quickly provision resources. With the Catchpoint Terraform provider, users can manage (Create, Read, Update, and Delete) Web, API, Transaction, DNS, SSL, BGP, Traceroute, and Ping tests with minimum configurations. To inherit sections such as Scheduling, Advanced Settings, Insights, and Alerts, simply omit the corresponding blocks.

##  **Prerequisites**

-    [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli)
-    Catchpoint account with a REST API V2 Token

## **Installation & Configuration**

1.  Download the appropriate binary attached to the bottom of this article per your operating system.
    * **Linux** - `terraform-provider-catchpoint`
    * **MacOS with M1 or M2 processor** - `terraform-provider-catchpoint_darwin_arm64`
    * **MacOS with Intel Processor** - `terraform-provider-catchpoint_darwin_amd64`

2.  Extract the files from the downloaded zip file:
    * `terraform-provider-catchpoint` (Terraform provider binary)
    * `main.tf` (configuration file example for Object Test)
(The additional subfolders each contain another main.tf file configured to set up another test type.)
3.  Place the binary and the desired `main.tf` file at `terraform.d/plugins/<SOURCE HOST>/<SOURCE NAMESPACE>/<PLUGIN NAME>/<VERSION>/linux_amd64`, relative to the root of the directory.
*Note: For MacOS the path name will change accordingly e.g. `~/.terraform.d/plugins/terraform-catchpoint/catchpointprovider/catchpoint/1.0.0/darwin_amd64`*
4.  Edit the `main.tf` file and modify the source host and namespace in the `required_providers` block to match the location where you placed the binary.
For example, if the `terraform-provider-catchpoint` binary is placed in `/.terraform.d/plugins/terraform-catchpoint/catchpointprovider/catchpoint/1.0.0/linux_amd64`, then the `required_providers` block in `main.tf` should look like this:
~~~
terraform {
    required_providers {
        catchpoint = {
            source = "catchpoint/catchpoint" 
            version = "1.1.0"
        }
    }
}
~~~
Pleas
3.  In the `main.tf` file add your API v2 key to the `provider` block.
~~~
provider "catchpoint" {api_token="8D7E2B17C339AD3EDCDD0761D29AXXXXXXXXXXXXX"}
~~~
***Note: if the API key is already exported to the environment variable `CATCHPOINT_API_TOKEN`, you may omit this block.***
4. Edit the `resource` block to reflect the test you want to manage or create. The table in the following section lists supported test types and their properties.
Example:
~~~
resource "web_test" "test" {
    provider=catchpoint
    division_id=1000
    product_id=15330
    test_name="catchpointTf"
    test_url="https://www.catchpoint.com"
    enable_test_data_webhook=true
    end_time="2023-09-05T04:59:00Z"
}
~~~
6. The `main.tf` file also includes sample blocks for the additional test settings sections. Any of these blocks you choose to keep will override inheritance for the corresponding settings in your test configuration. Any omitted blocks will be inherited from the parent Folder/Product.

**Example:**
```
resource "web_test" "test" {
    provider=catchpoint
    monitor="object"
    division_id=1000
    product_id=15330
    test_name="catchpointTf"
    test_url="https://www.catchpoint.com"
    enable_test_data_webhook=true
    end_time="2023-09-05T04:59:00Z"
    request_settings {
        http_request_headers {
            user_agent {
                value="terraform"
            }
            accept {
                value="application/json"
                child_host_pattern="www.google.com"
            }
        }
    } 
    schedule_settings {
        frequency="60 minutes"
        node_distribution="concurrent" node_ids=[12,136]
    }
    alert_settings {
        alert_rule {
            alert_type="test failure"
            node_threshold_type="runs"
            threshold_number_of_runs=2
            threshold_percentage_of_runs=60
        }
        notification_group {
            recipient_email_ids=["recipient1@example.com"]
        }
    }
}
```

## Supported Properties
This table lists the main properties supported for each Catchpoint test type, as well as the names of the optional settings blocks you may include. You can omit any unneeded blocks and those settings will be inherited from the parent Product/Folder. In general, the property names in the `main.tf` file should match the corresponding field labels in the Catchpoint Portal, but are all lower-case and use underscores (_) in place of  spaces. (e.g. the **Test Name** property will be added to the `main.tf` file as `"test_name"`)

<table>
	<tr>
		<th>Resource Type</th>
		<th>Configuration Settings</th>
	</tr>
    <tr>
		<td>
			<strong>All (these settings apply to all resource types)</strong>
		</td>
		<td>            
			<ul>
				<li>test_name</li>
				<li>status ("active" or "inactive")</li>
				<li>test_description</li>
				<li>monitor (for test types that support multiple monitors)</li>
                <li>provider ("catchpoint" or match configured provider name in <strong>required providers</strong> block)</li>
                <li>division_id (include if your account uses divisions)</li>
                <li>product_id</li>
                <li>folder_id (include if test is located in a folder)</li>				
				<li>gateway_address_host</li>
				<li>alerts_paused ("true" or "false")</li>
				<li>start_date</li>
				<li>end_date</li>				
				<li>enable_test_data_webhook ("true" or "false")</li>
			</ul>			
		</td>
	</tr>
	<tr>
		<td>
			<strong>web_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>simulate (for mobile, mobile playback monitors)</li>
				<li>chrome_version (for chrome monitor)</li>				
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>request_settings</li>
				<li>labels</li>
				<li>insights</li>
				<li>scheduling</li>
				<li>alerts (test failure, page failure, availability, timing)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>api_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>script_type (selenium or javascript)</li>
				<li>script</li>
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>request_settings</li>
				<li>labels</li>
				<li>insights</li>
				<li>scheduling</li>
				<li>alerts (test failure, host failure, timing, byte length, content match, insight, requests)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>transaction_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>simulate (for mobile monitor)</li>
                <li>chrome_version (for chrome monitor)</li>
				<li>script</li>				
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>request_settings</li>
				<li>labels</li>
				<li>insights</li>
				<li>scheduling</li>
				<li>alerts (test failure, host failure, timing, insights, byte length, content match, host failure, zone data, requests)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>traceroute_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>test_location</li>				
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>labels</li>
				<li>scheduling</li>
				<li>alerts (test failure, asn, path, ping)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>ping_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>test_location</li>				
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>labels</li>
				<li>scheduling</li>
				<li>alerts (test failure, ping)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>dns_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>test_domain</li>
				<li>dns_server (for dns direct monitor)</li>
				<li>query_type</li>
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>labels</li>
				<li>scheduling</li>
				<li>alerts (test failure)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>bgp_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>
				<li>prefix</li>		
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>labels</li>
				<li>alerts (test failure, asn)</li>
			</ul>
		</td>
	</tr>
	<tr>
		<td>
			<strong>ssl_test</strong>
		</td>
		<td>
            <strong>Test Properties</strong>
			<ul>                
				<li>test_location</li>				
				<li>enforce_certificate_pinning</li>
				<li>enforce_public_key_pinning</li>
			</ul>
			<strong>Optional Blocks</strong>
			<ul>
				<li>thresholds</li>
				<li>advanced_settings</li>
				<li>labels</li>
				<li>scheduling</li>
				<li>alerts (test failure, timing)</li>
			</ul>
		</td>
	</tr>
</table>



## **How To Run**

1. Create a directory with an arbitrary name.
2. Navigate to the newly created directory.
3. Create the `main.tf` file with all the blocks mentioned above. Use any of the sample `main.tf` files from the attached .zip file for reference.
4. In the terminal, run `terraform init` to initialize the provider.
5. Run `terraform plan` to see the changes to be applied.
6. Run `terraform apply` to apply the plan. If [Terraform Debug     logs](https://www.terraform.io/plugin/log/managing) are enabled, the API response can be seen from the Catchpoint provider. The logs will indicate whether the test was created successfully.

## **Results**

**![Tera.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/6893210230043-Tera.png)**

@(Embed)(https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/terraform-provider-catchpoint_darwin_arm64%20(1)%202.zip)
@(Embed)(https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/terraform-provider-catchpoint_darwin_amd64%202.zip)
@(Embed)(https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/terraform-provider-catchpoint%20(1)%202(1).zip)
