Terraform variable reference#
Inputs and outputs of the common materialize-monitoring Terraform module.
Most deployments do not set these directly — a per-cloud wrapper in
materialize-terraform-self-managed
forwards the ones that matter and supplies the storage and identity inputs itself.
See Installing via Terraform for the
variables you actually set in a terraform.tfvars.
Inputs#
| Variable | Type | Description | Default / Schema | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| additional_ | list(string) | Raw YAML documents appended to the Helm values, in order, after everything this module computes.
Later documents win, so anything here overrides the module's opinion. This is the supported way to reach chart settings the module does not model — including scheduling (node selectors, tolerations) and Grafana ingress, neither of which the module surfaces yet. See the README. Each element is one YAML document. | [] | |||||||||||||||
| certificate_ | string | Lifetime of each issued certificate, as a Go duration (e.g. `2160h`). Null
keeps the chart's default of 90 days. Keep | &{} | |||||||||||||||
| certificate_ | string | How long before expiry cert-manager renews, as a Go duration (e.g. `720h`). Null keeps the chart's default of 30 days. See the warning on `certificate_duration`. | &{} | |||||||||||||||
| certificates_ | bool | Render cert-manager `Certificate` resources for in-cluster TLS. Requires cert-manager to already be installed, with its CRDs present.
This module does not install it — the same shared-responsibility split as
buckets and workload identity — so with the flag on and cert-manager absent
the apply fails on an unknown Off by default rather than on. The design calls for the Terraform path to be secure by default, and that becomes safe once a wrapper that installs cert-manager owns the default; flipping it here today would break every existing consumer’s next apply. Issuing certificates does not turn TLS on anywhere — | false | |||||||||||||||
| chart_ | string | OCI registry holding the materialize-monitoring charts. Override for a mirrored or air-gapped registry. | oci://ghcr.io/materializeinc/helm-charts | |||||||||||||||
| chart_ | string | Version of the materialize-monitoring chart. Leave null, which is the supported path: the module reads the version out of the chart’s own
| &{} | |||||||||||||||
| crds_ | string | Version of the materialize-monitoring-crds chart. Read from its `Chart.yaml` when null, like `chart_version`. Tracked separately because the CRDs chart has a deliberately looser lifecycle. | &{} | |||||||||||||||
| create_ | bool | Whether this module creates the namespace. Defaults to false because the Materialize operator module already creates `monitoring` in the supported topology. | false | |||||||||||||||
| datadog_ | string | Datadog API key for `datadog_metrics`. Delivered as a Secret this module creates ( An app key is not needed and is not accepted here; the metrics intake authenticates with the API key alone. | &{} | |||||||||||||||
| datadog_ | schema | Also export metrics to Datadog from the Alloy gateway. Null disables it; Thanos is unaffected
either way. Pair it with `datadog_api_key`, which is what actually authenticates.
| | |||||||||||||||
| enable_ | bool | Install the materialize-monitoring-crds chart (prometheus-operator and grafana-operator CRDs). Set false when the cluster already has them from elsewhere — kube-prometheus-stack, or a platform team that owns CRDs centrally — since Terraform would otherwise fail trying to create objects it does not own. Note the teardown blast radius: destroying this release deletes the CRDs, which cascades to
every GrafanaDashboard, GrafanaDatasource, PrometheusRule, and PodMonitor in the cluster,
including ones this stack did not create. It is a separate The Grafana custom resources still have to go before grafana-operator does, or their
finalizers have no remover and the CRDs wedge in Terminating. The chart’s | true | |||||||||||||||
| enable_ | bool | Enable the SQL-on-scrape collector against environmentd. On by default. The chart currently works with an empty password. | true | |||||||||||||||
| gateway_ | map(string) | Annotations for the Alloy gateway's ServiceAccount, for binding it to a cloud identity —
`eks.amazonaws.com/role-arn` for IRSA, `iam.gke.io/gcp-service-account` for Workload Identity. Required by a | map[] | |||||||||||||||
| google_ | schema | Also export metrics to Google Cloud Monitoring from the Alloy gateway. Null disables it; Thanos
is unaffected either way.
Authentication is ADC only. Bind the gateway ServiceAccount to a Google service account holding
| | |||||||||||||||
| grafana_ | string | Grafana admin password. Generated when null. Supplied to Grafana as a Secret this module owns, rather than letting the bundled chart mint one — the chart's own generation does not survive upgrades. | &{} | |||||||||||||||
| grafana_ | string | Grafana admin username. | admin | |||||||||||||||
| grafana_ | bool | Whether to point Grafana at PostgreSQL at all. Null infers it from | &{} | |||||||||||||||
| grafana_ | string | Hostname of the PostgreSQL database backing Grafana's own state. Null (the default) leaves Grafana on SQLite, where everything created through the UI is lost on every restart. Host only — the port is `grafana_database_port`. | &{} | |||||||||||||||
| grafana_ | bool | Whether this module creates the Secret holding the database password, and references it from
`grafana.ini` with `$__file{}`. Null infers it from False is not a way to supply the password by another route: it means no Secret and no
| &{} | |||||||||||||||
| grafana_ | string | Name of the database Grafana owns. | grafana | |||||||||||||||
| grafana_ | string | Password for `grafana_database_user`, supplied to Grafana as a Secret this module owns and read
from a mounted file rather than the environment. Never inlined into Null when the connection needs no password — a Cloud SQL Auth Proxy sidecar with
| &{} | |||||||||||||||
| grafana_ | number | Port for `grafana_database_host`. | 5432 | |||||||||||||||
| grafana_ | string | libpq SSL mode for the Grafana database connection.
| require | |||||||||||||||
| grafana_ | string | Database user Grafana connects as. Must own `grafana_database_name`, because Grafana runs schema migrations at startup. | grafana | |||||||||||||||
| grafana_ | list(string) | Public DNS names to put on a browser-facing certificate for Grafana, issued
from `var.issuer_ref`. Only needed behind an L4 load balancer, which passes TCP through and
leaves TLS to terminate at the pod, so the material has to exist in the
cluster. An L7 load balancer terminating with a cloud-managed certificate
(ACM, Google Certificate Manager, Azure Key Vault) attaches it by ARN or
resource ID and the key never enters the cluster — for that shape leave this
empty and pass the annotation through Setting this with no | [] | |||||||||||||||
| install_ | bool | Install metrics-server as part of this stack. Leave false when the Materialize operator module installs it (the default topology), and set
it true when that module has | false | |||||||||||||||
| install_ | bool | Install node-exporter as part of this stack. On by default: node-level metrics are part of the stack’s baseline, and nothing else in it
collects them. Set false when the cluster already runs its own node-exporter DaemonSet — a
second one wastes a per-node slot and produces the same series twice under two This writes the chart’s | true | |||||||||||||||
| install_ | number | Timeout for each Helm release, in seconds. Well above Helm's 300s default: a first install brings up Loki, Thanos, Grafana, and both Alloy roles together. | 900 | |||||||||||||||
| internal_ | schema | Optional override for the issuer signing cluster-internal certificates
(those carrying `*.svc. Required when Under the chart’s | | |||||||||||||||
| internal_ | string | How far the in-cluster hops move off plaintext. Requires
`certificates_enabled`, which is what issues the material these settings
point at. The stages are the chart’s own
Two hops stop short of | off | |||||||||||||||
| issuer_ | schema | Default cert-manager (Cluster)Issuer used for the monitoring stack's TLS
certificates. Used for both the external (browser-facing) certificate and
the internal ones unless overridden by `var.internal_issuer_ref`. Leave null with | | |||||||||||||||
| materialize_ | string | Namespace the Materialize instance runs in. Used to scope scrape targets. | materialize-environment | |||||||||||||||
| materialize_ | string | Namespace the Materialize operator runs in. | materialize | |||||||||||||||
| min_ | number | Number of availability zones the node pool can actually launch in, used to adjust the hard zone
spread on Thanos Receive and Loki's ingesters. Null leaves the chart's defaults alone, which
assume two or more zones and is correct for every managed cloud default. Set this when that assumption does not hold, because the chart’s constraints fail closed rather than degrading:
Leaving this null on a cluster with fewer than two zones leaves those pods Pending forever
rather than unbalanced: below | &{} | |||||||||||||||
| namespace | string | Namespace to install the monitoring stack into. | monitoring | |||||||||||||||
| node_ | map(string) | Node selector for the centralized monitoring workloads. Not applied to the Alloy agent: it is a DaemonSet that must reach every node to collect logs and node metrics, so constraining it to a workload pool would silently stop collection everywhere else. | map[] | |||||||||||||||
| object_ | schema | Buckets and workload identity for the logging and metrics backends, supplied by the per-cloud
wrapper module. Leave null to configure storage yourself through `additional_values`.
| | |||||||||||||||
| object_ | string | Static access key for an S3-compatible object store, for deployments that have no workload
identity to bind to — an on-prem or self-hosted store (MinIO, rustfs, Ceph), or a cluster whose
IAM provider does not trust its OIDC issuer. Prefer workload identity wherever it exists: it rotates, and the
Set both or neither. | &{} | |||||||||||||||
| object_ | string | Secret key paired with `object_storage_access_key_id`. Reaches the backends as a Secret in both cases, never a ConfigMap: Thanos already renders its
objstore config into one, and the module switches Loki’s | &{} | |||||||||||||||
| otlp_ | string | Bearer token for `otlp_metrics`, for endpoints that take an `Authorization: Bearer` header
rather than a vendor-specific one. Delivered as a Secret this module creates ( | &{} | |||||||||||||||
| otlp_ | map(string) | Secret request headers for `otlp_metrics`, as header name to value — Honeycomb's
`x-honeycomb-team`, for instance. This is the API-key-header case, which is how most OTLP
vendors authenticate. Each value is delivered as a Secret this module creates ( Non-secret headers belong in | map[] | |||||||||||||||
| otlp_ | schema | Also export metrics to a generic OTLP endpoint from the Alloy gateway — Honeycomb, Grafana
Cloud, or your own OpenTelemetry Collector. Null disables it; Thanos is unaffected either way.
| | |||||||||||||||
| prometheus_ | schema | Prometheus remote-write destinations for the Alloy gateway, keyed by name — Amazon Managed
Prometheus, Grafana Cloud, Mimir, another Thanos. Empty leaves the chart's single bundled
Thanos destination exactly as it is. The key names the destination and becomes its Alloy component label, so it must match
Each destination gets its own remote-write component and its own upstream tier filter, so
| | |||||||||||||||
| prometheus_ | schema | Credentials for `prometheus_remote_write` destinations whose `auth_type` is `basicAuth` or
`bearer`, keyed by the same destination name. Delivered as a Secret this module creates (
| | |||||||||||||||
| sizing | string | Deployment size. The chart's defaults target `medium`, and the small/large profiles are deltas
from it, so `medium` intentionally applies no profile at all. Profiles are read from the chart directory in this repository at the same commit as the pinned chart version, so they cannot drift from it. A profile that does not exist yet is skipped, which is how Thanos sizing will start applying once those profiles land. | medium | |||||||||||||||
| sql_ | string | Password for the SQL scraper's database user. | | |||||||||||||||
| storage_ | string | StorageClass for the PVC-backed workloads. Null uses the cluster default. Four are PVC-backed by default: Alertmanager, the Loki ruler, and the Thanos Store Gateway and
Compactor. Loki’s ingesters and Thanos Receive use node-local Required where the default class cannot serve the nodes: GCP’s C4 and N4 families take only
Hyperdisk, and every Persistent Disk class fails to attach with Changing it on an existing install does not move the volumes. | &{} | |||||||||||||||
| tolerations | schema | Tolerations for the monitoring workloads, including the Alloy agent DaemonSet — tolerations widen where a pod may run, which is what a DaemonSet wants. | |
Outputs#
| Name | Description |
|---|---|
| chart_version | Chart version this release is pinned to. |
| grafana_admin_password | Grafana admin password. |
| grafana_admin_secret_name | Name of the Secret holding the Grafana admin credentials. |
| grafana_admin_user | Grafana admin username. |
| grafana_url | In-cluster URL for Grafana, which is what the module deploys by default. The chart can expose Grafana through grafana.ingress or grafana.service supplied via additional_values; this output does not follow that yet, so use the external hostname you configured there instead. |
| logs_url | Loki read endpoint (query frontend). Reads carry a tenant header; see the chart’s datasource configuration. |
| metrics_url | Thanos Query endpoint. Prometheus-API-compatible, so consumers of a Prometheus URL keep working against it. |
| namespace | Namespace the monitoring stack is installed into. |
| release_name | Name of the materialize-monitoring Helm release. |
| remote_write_url | Thanos Receive remote-write endpoint, for writers outside this stack. |
| service_account_names | ServiceAccount names the chart renders for storage-bound components. |
| workload_identity_subjects | system:serviceaccount:<namespace>:<sa> subjects for the components that bind to cloud object storage. Use these when building IRSA / Workload Identity trust policies. |