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

# Environment Variables in Terraform

> Manage environment variables to reduce duplication in your monitoring setup

[Environment variables](https://www.checklyhq.com/docs/platform/variables.md) store sensitive data like credentials or configuration values that can be used across checks and groups.

> **Check-level variables**
>
> ```terraform theme={null}
> resource "checkly_check" "user-login" {
>   name      = "User Login Flow"
>   type      = "BROWSER"
>   activated = true
>   frequency = 5
>
>   environment_variables = {
>     TEST_EMAIL    = "user@example.com"
>     TEST_PASSWORD = "secure-password"
>     API_BASE_URL  = "https://api.example.com"
>   }
>
>   locations = ["us-west-1", "eu-central-1"]
>   script    = file("${path.module}/scripts/login.spec.js")
> }
> ```
>
> Variables defined at check level are only available to that specific check.

> **Group-level variables**
>
> ```terraform theme={null}
> resource "checkly_check_group" "ecommerce-flows" {
>   name      = "E-commerce Flows"
>   activated = true
>
>   environment_variables = {
>     TEST_EMAIL    = "user@example.com"
>     TEST_PASSWORD = "secure-password"
>     API_BASE_URL  = "https://api.example.com"
>   }
>
>   locations   = ["us-west-1", "eu-central-1"]
>   concurrency = 3
> }
> ```
>
> Variables defined at group level are inherited by all checks within that group.

> [!NOTE]
>
> Account-level environment variables via Terraform are coming soon. For now, use check or group-level variables for your monitoring setup.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.