scalr_grafana_integration

Resource: scalr_grafana_integration

Manages the state of Grafana integrations in Scalr. The integration sends Scalr audit logs and run events to Grafana Cloud or a self-hosted Loki over OTLP.

Example Usage

# Grafana Cloud
resource "scalr_grafana_integration" "example" {
  name      = "grafana-cloud"
  kind      = "cloud"
  endpoint  = "https://otlp-gateway-prod-eu-west-2.grafana.net/otlp"
  auth_type = "basic"
  username  = "123456" # Grafana Cloud instance ID
  secret    = var.grafana_cloud_token
}

# Self-hosted multi-tenant Loki
resource "scalr_grafana_integration" "loki" {
  name      = "loki"
  kind      = "loki"
  endpoint  = "https://loki.example.com/otlp"
  auth_type = "bearer"
  secret    = var.loki_token
  tenant_id = "scalr"
}

Schema

Required

  • auth_type (String) Authentication scheme: basic or bearer. Grafana Cloud requires basic.
  • endpoint (String) Base OTLP URL, for example https://otlp-gateway-prod-eu-west-2.grafana.net/otlp. Must use https and must not end with /v1/logs.
  • kind (String) Grafana destination: cloud for Grafana Cloud or loki for a self-hosted Loki.
  • name (String) Name of the Grafana integration.

Optional

  • secret (String, Sensitive) Basic auth password or bearer token. On Grafana Cloud, an access policy token.
  • tenant_id (String) Loki tenant ID, sent as the X-Scope-OrgID header. For a multi-tenant loki only.
  • username (String) Basic auth username. On Grafana Cloud, the numeric instance ID.

Read-Only

  • account_id (String) ID of the account the integration belongs to.
  • err_message (String) Error message reported by Scalr when the integration is in the failed status.
  • id (String) The ID of this resource.
  • status (String) Status of the integration: active, disabled or failed. Scalr sets the failed status when the endpoint rejects the credentials during delivery.

Import

Import is supported using the following syntax:

terraform import scalr_grafana_integration.example in-xxxxxxxxxx

Did this page help you?