Resource
dcloud_app_errors_binding
Connects an app to an Error Tracking project: every build and rollout gets SENTRY_DSN, NEXT_PUBLIC_SENTRY_DSN, SENTRY_ENVIRONMENT and SENTRY_RELEASE (the commit); every build also gets a SENTRY_AUTH_TOKEN for source-map upload to this project, minted for that build and revoked when it ends. The DSN is filed in Secrets as a managed entry. A variable the app defines itself wins. Destroying it disconnects; the project is unchanged.
Example Usage
resource "dcloud_errors_project" "web" {
name = "web"
platform = "javascript-nextjs"
}
# SENTRY_DSN, NEXT_PUBLIC_SENTRY_DSN, SENTRY_ENVIRONMENT and SENTRY_RELEASE at build
# and run time, and a per-build SENTRY_AUTH_TOKEN for source maps: nothing to paste.
resource "dcloud_app_errors_binding" "web" {
app_id = dcloud_app.web.id
project_id = dcloud_errors_project.web.id
}Schema
Required
app_id(String) The id of the parent resource ({id}in the path). Changing it replaces the resource.project_id(String) Error Tracking project id. A UUID.
Optional
dsn_env(String) Server DSN variable (default SENTRY_DSN). Must match^([A-Za-z_][A-Za-z0-9_]{0,127})?$.environment(String) SENTRY_ENVIRONMENT; omitted: the app’s secrets environment, else production. Up to 64 characters. Must match^[^\s/]+$.environment_env(String) Environment variable (default SENTRY_ENVIRONMENT). Must match^([A-Za-z_][A-Za-z0-9_]{0,127})?$.public_dsn_env(String) Browser DSN variable (default NEXT_PUBLIC_SENTRY_DSN; VITE_SENTRY_DSN or PUBLIC_SENTRY_DSN for Vite and SvelteKit). Must match^([A-Za-z_][A-Za-z0-9_]{0,127})?$.redeploy(Boolean) Rebuild and redeploy the live commit, so the DSN reaches the browser bundle and source maps are uploaded. Never returned by the API: not read back, and empty after an import.release_env(String) Release variable (default SENTRY_RELEASE). Must match^([A-Za-z_][A-Za-z0-9_]{0,127})?$.
Read-Only
dsn(String) The DSN the app gets (send-only; it ships in the browser bundle).effective_environment(String) WhatSENTRY_ENVIRONMENTsays:environment, else the app's secrets environment, elseproduction.id(String) The resource's id.secret_id(String) The managed Secrets entry holding the DSN.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import dcloud_app_errors_binding.web <app-id>Generated from the provider's schema.
Related