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#

VariableTypeDescriptionDefault / Schema
additional_valueslist(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.

[]
chart_registrystringOCI registry holding the materialize-monitoring charts. Override for a mirrored or air-gapped registry.oci://ghcr.io/materializeinc/helm-charts
chart_versionstringVersion of the materialize-monitoring chart.

Leave null, which is the supported path: the module reads the version out of the chart’s own Chart.yaml in this repository, so a module ref always installs the chart it shipped with and the two cannot drift. Set it only to pin a chart version different from the module’s.

&{}
crds_chart_versionstringVersion 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_namespaceboolWhether this module creates the namespace. Defaults to false because the Materialize operator module already creates `monitoring` in the supported topology.false
enable_monitoring_crdsboolInstall 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 helm_release so it can be targeted independently (-target=module.monitoring.helm_release.crds).

Teardown also needs the Grafana custom resources deleted before grafana-operator goes, or their finalizers have no remover and the CRDs wedge in Terminating. See the “Uninstalling” page in the docs.

true
enable_sql_scraperboolEnable the SQL-on-scrape collector against environmentd.

Off by default. The chart enables it with an empty password, and no mz_support role is provisioned by the Materialize Terraform modules, so it would come up failing authentication. It also targets the legacy metric surface that native endpoints are replacing.

Supply sql_scraper_password when enabling it.

false
google_cloud_metricsschemaAlso export metrics to Google Cloud Monitoring from the Alloy gateway. Null disables it; Thanos is unaffected either way.

min_importance picks a metric tier — essential, recommended, extended, diagnostic, or all — and each tier includes the ones below it. This is a cost control: GCM bills per custom metric and all sends the entire surface.

Authentication is ADC only. Bind the gateway ServiceAccount to a Google service account holding roles/monitoring.metricWriter through object_storage.gateway_service_account_annotations; failing that it falls back to the node’s service account, which works only if that account has the role.

object({
    min_importance = optional(string, "recommended")
    prefix         = optional(string)
  })
grafana_admin_passwordstringGrafana 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_admin_userstringGrafana admin username.admin
install_metrics_serverboolInstall 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 install_metrics_server = false — otherwise nothing provides the metrics API and the Materialize Console silently loses cluster metrics.

false
install_timeoutnumberTimeout 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
materialize_instance_namespacestringNamespace the Materialize instance runs in. Used to scope scrape targets.materialize-environment
materialize_operator_namespacestringNamespace the Materialize operator runs in.materialize
namespacestringNamespace to install the monitoring stack into.monitoring
node_selectormap(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_storageschemaBuckets 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`.

cloud selects the objstore dialect. The *_service_account_annotations maps carry the workload-identity annotation for each component’s ServiceAccount — the chart validates that the annotation’s cloud matches the objstore backend, so a mismatched pair fails at render time rather than at pod start.

azure_storage_account is required when cloud is azure, and only then: both Loki and Thanos name the account separately from the container. Azure needs nothing else — the annotation plus the pod label the module applies are all the Entra webhook requires.

object({
    cloud                               = string
    loki_bucket                         = string
    thanos_bucket                       = string
    region                              = optional(string)
    endpoint                            = optional(string)
    azure_storage_account               = optional(string)
    loki_service_account_annotations    = optional(map(string), {})
    thanos_service_account_annotations  = optional(map(string), {})
    gateway_service_account_annotations = optional(map(string), {})
  })
sizingstringDeployment 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_scraper_passwordstringPassword for the SQL scraper's database user. Required when `enable_sql_scraper` is true.&{}
storage_classstringStorageClass for the five PVC-backed workloads (Alertmanager, the Loki ruler, and Thanos receive/compactor/store-gateway). Null uses the cluster default. Loki's ingesters are unaffected — node-local `emptyDir` by design.

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 pd-balanced disk type cannot be used by <machine-type>.

Changing it on an existing install does not move the volumes. volumeClaimTemplates are immutable, so the old PVCs must be deleted first — discarding their contents.

&{}
tolerationsschemaTolerations for the monitoring workloads, including the Alloy agent DaemonSet — tolerations widen where a pod may run, which is what a DaemonSet wants.
list(object({
    key      = optional(string)
    operator = optional(string, "Equal")
    value    = optional(string)
    effect   = optional(string)
  }))

Outputs#

NameDescription
chart_versionChart version this release is pinned to.
grafana_admin_passwordGrafana admin password.
grafana_admin_secret_nameName of the Secret holding the Grafana admin credentials.
grafana_admin_userGrafana admin username.
grafana_urlIn-cluster URL for Grafana. Grafana is ClusterIP-only today, so reaching it from outside the cluster needs a port-forward.
logs_urlLoki read endpoint (query frontend). Reads carry a tenant header; see the chart’s datasource configuration.
metrics_urlThanos Query endpoint. Prometheus-API-compatible, so consumers of a Prometheus URL keep working against it.
namespaceNamespace the monitoring stack is installed into.
release_nameName of the materialize-monitoring Helm release.
remote_write_urlThanos Receive remote-write endpoint, for writers outside this stack.
service_account_namesServiceAccount names the chart renders for storage-bound components.
workload_identity_subjectssystem:serviceaccount:<namespace>:<sa> subjects for the components that bind to cloud object storage. Use these when building IRSA / Workload Identity trust policies.