Provider Configuration
The Uptime provider supports two authentication methods: user API tokens and project tokens. All configuration can also be set via environment variables.
API Token Authentication
Use an API token (Firebase JWT) for user-level authentication. This requires an org_id to scope operations to an organization.
hcl
provider "uptime" {
host = "https://uptime-prod-api-5bbjdhyfxa-ts.a.run.app"
api_token = var.uptime_api_token
org_id = var.uptime_org_id
}Project Token Authentication
Project tokens are designed for machine authentication in CI/CD pipelines. The token encodes the organization, so org_id is optional.
hcl
provider "uptime" {
host = "https://uptime-prod-api-5bbjdhyfxa-ts.a.run.app"
project_token = var.uptime_project_token
}Mutually Exclusive
You must provide either api_token or project_token, but not both. The provider will return an error if both are set.
Environment Variables
All provider arguments can be set via environment variables. This is the recommended approach for CI/CD pipelines to avoid hardcoding secrets.
bash
export UPTIME_HOST="https://uptime-prod-api-5bbjdhyfxa-ts.a.run.app"
export UPTIME_PROJECT_TOKEN="upt_..."
# Then in your Terraform config, no arguments needed:
# provider "uptime" {}| Environment Variable | Provider Argument |
|---|---|
UPTIME_HOST | host |
UPTIME_API_TOKEN | api_token |
UPTIME_PROJECT_TOKEN | project_token |
UPTIME_ORG_ID | org_id |
Argument Reference
| Name | Type | Status | Description |
|---|---|---|---|
host | String | Optional | The Uptime API host URL. Can also be set via UPTIME_HOST env var.Default: http://localhost:8080 |
api_token | String | Optional | Firebase JWT for user authentication. Can also be set via UPTIME_API_TOKEN env var. Mutually exclusive with project_token. Sensitive |
project_token | String | Optional | Project-scoped token for machine authentication (CI/CD, Terraform). Can also be set via UPTIME_PROJECT_TOKEN env var. Mutually exclusive with api_token. Sensitive |
org_id | String | Optional | Default organization ID. Required with api_token, optional with project_token (token encodes org). Can also be set via UPTIME_ORG_ID env var. |