Dash0 acquires Polar Signals

Last updated:

dash0_auth_token

Terraform resource for Dash0 auth tokens — organization-level credentials for telemetry ingestion and the Dash0 API, with the secret exposed as a sensitive attribute.

Manages a Dash0 auth token. Auth tokens are organization-level credentials for the Dash0 API and for telemetry ingestion.

Note

Managing auth tokens requires an admin user or an auth token with the * action and no dataset or signal restriction. Any other token receives a 403.

Note

The secret is stored in the Terraform state in plain text, in the sensitive token attribute. Protect the state accordingly.

Note

The secret is only available for tokens created by Terraform. Imported tokens have a null token.

Note

Dash0 refuses to delete the last auth token of an organization. Destroying it fails with the API error.

The secret is generated by Dash0, returned only when the token is created, and cannot change. Imported tokens have no secret in the state. To rotate it without downtime, add a second resource, move the consumers to its secret, and remove the old resource in a later apply. The name, actions, and dataset and signal restrictions update in place. The origin cannot change.

Example Usage

terraform
# Manage a Dash0 auth token declaratively. Auth tokens are organization-level
# credentials for telemetry ingestion and the Dash0 API.
#
# Managing auth tokens requires an admin user or a token with the `*` action
# and no dataset or signal restriction.
#
# Do not set spec.token. Dash0 generates the secret; read it from the
# sensitive `token` attribute. The secret is stored in the Terraform state in
# plain text.
resource "dash0_auth_token" "ingest" {
  auth_token_yaml = <<-YAML
apiVersion: dash0.com/v1alpha1
kind: Dash0AuthToken
metadata:
  name: Production ingestion
spec:
  # ingest:* is the "Ingesting" option in the Dash0 UI.
  actions:
    - ingest:*
  # Limit the signals with scope.signals (the "Signal types" field in the UI).
  scope:
    signals:
      restriction: restricted
      types:
        - logs
        - metricDataPoints
        - spans
YAML
}

# The secret, for example to configure an OpenTelemetry Collector.
output "ingest_token" {
  value     = dash0_auth_token.ingest.token
  sensitive = true
}

# To rotate the secret without downtime, add a second dash0_auth_token
# resource, move the consumers to its secret, and remove the old resource in a
# later apply.

# You can also load the YAML definition from a file:
#
# resource "dash0_auth_token" "ingest" {
#   auth_token_yaml = file("${path.module}/auth-tokens/ingest.yaml")
# }

Actions

spec.actions sets what the token can do. The valid actions are:

ActionDash0 UI optionGrants
*All permissionsFull access
*:readReadingRead access to the Dash0 API
ingest:*IngestingIngestion of all signals
ingest:logsIngestion of logs
ingest:metricsIngestion of metrics
ingest:spansIngestion of spans
ingest:profilesIngestion of profiles

There are two ways to limit the signals of an ingestion token:

  • Use per-signal actions, such as ingest:logs and ingest:spans.
  • Use ingest:* with spec.scope.signals, as in the example above. This is the Signal types field in the Dash0 UI.

Profiles need ingest:profiles or ingest:*.

Note

A token without the action for a signal drops that signal's data without an error.

See Auth tokens for the permissions and signal types.

Rotating the secret

The secret cannot change in place. To rotate it without downtime, keep two tokens side by side:

  1. Add a second dash0_auth_token resource and apply.
  2. Move the consumers to the secret of the new token.
  3. Remove the old resource and apply again.

terraform apply -replace=dash0_auth_token.ingest deletes the old token in the same run, so consumers lose access until they get the new secret. create_before_destroy only narrows that gap. Use -replace only when downtime is acceptable.

Omitted fields

When you remove a field from auth_token_yaml, Dash0 keeps its current value and Terraform stops checking that field for drift. To reset a field, set it to the value you want (usually the default) and keep it in the YAML. See the Dash0 API reference for the fields and their defaults.

Destroying an auth token

Dash0 refuses to delete the last auth token of an organization. Destroying it fails with the API error. Keep at least one other auth token before you destroy it.

Schema

Required

  • auth_token_yaml (String) The auth token definition in YAML format, with apiVersion: dash0.com/v1alpha1, kind: Dash0AuthToken, metadata.name for the display name, and spec.actions for the permissions. Optional spec fields are ingestion.defaultDataset, scope.datasets (restriction and slugs), and scope.signals (restriction and types). Omitted optional fields keep the server's values without causing a diff. Do not set spec.token: the secret is exposed through the token attribute.

Read-Only

  • id (String) The auth token ID (a UUID), assigned by Dash0.
  • origin (String) A unique identifier for the auth token, generated by the provider on creation. Null for auth tokens imported without an origin.
  • token (String, Sensitive) The secret of the auth token, assigned by Dash0. Use it as the bearer token or ingestion token. Dash0 returns the secret only when the token is created, so it is only available for tokens created by Terraform. Imported tokens have a null token.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

shell
#!/bin/bash
# Auth tokens are organization-scoped, so the import ID has no dataset prefix.
# Use the auth token ID (a UUID) or its origin.
terraform import dash0_auth_token.ingest 5f1c4a52-7a6e-4c4e-9d0e-3f6a1b2c3d4e

Dash0 returns the secret only when it creates the token, so an imported token has a null token attribute. Terraform manages it, but cannot read its secret.