# Environment Variables in Terraform - Checkly Docs

> Manage environment variables to reduce duplication in your monitoring setup

Source: https://www.checklyhq.com/docs/integrations/iac/terraform/environment-variables/

---

Terraform

# Environment Variables in Terraform

Manage environment variables to reduce duplication in your monitoring setup

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

Check-level variables

```
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

```
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.

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

Was this page helpful?

[Suggest edits](https://github.com/checkly/docs/edit/main/integrations/iac/terraform/environment-variables.mdx)[Raise issue](https://github.com/checkly/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/integrations/iac/terraform/environment-variables)

[Testing Terraform scripts locally Previous](https://www.checklyhq.com/docs/integrations/iac/terraform/testing-scripts-locally)[Common issues with the Terraform provider Next](https://www.checklyhq.com/docs/integrations/iac/terraform/troubleshooting)

[x](https://x.com/checklyhq)[github](https://github.com/checkly)[linkedin](https://linkedin.com/company/checkly)

[Powered by This documentation is built and hosted on Mintlify, a developer documentation platform](https://www.mintlify.com/?utm_campaign=poweredBy&utm_medium=referral&utm_source=checkly-422f444a)
