Doppler to Terraform Exporter

Turn Doppler exports into Terraform-ready variables and resource stubs.

Paste Doppler JSON or .env content, preview the converted Terraform, then copy what you need. The Pro tier will add provider-aware mapping, module packaging, and direct file export.

Input

Accepts a JSON object export or standard KEY=value env lines.

Detected secrets

5 items mapped to Terraform-friendly variable names.

STRIPE_SECRET_KEYvar.stripe_secret_keystringsensitive
NEXT_PUBLIC_API_BASE_URLvar.next_public_api_base_urlstringplain
FEATURE_FLAG_BETAvar.feature_flag_betaboolplain
MAX_RETRIESvar.max_retriesnumberplain
ALLOWED_ORIGINSvar.allowed_originslist(string)plain
Pro unlock

Need file export, module generation, or provider-specific transforms?

Stripe wasn't discoverable in local env/docs, so this build uses the existing waitlist signup for Pro access.

Join the Pro waitlist

variables.tf

Generated variable definitions with inferred types and sensitivity.

variable "stripe_secret_key" {
  type = string
  description = "Imported from Doppler key STRIPE_SECRET_KEY"
  sensitive = true
  default = "sk_live_xxx"
}

variable "next_public_api_base_url" {
  type = string
  description = "Imported from Doppler key NEXT_PUBLIC_API_BASE_URL"
  sensitive = false
  default = "https://api.example.com"
}

variable "feature_flag_beta" {
  type = bool
  description = "Imported from Doppler key FEATURE_FLAG_BETA"
  sensitive = false
  default = true
}

variable "max_retries" {
  type = number
  description = "Imported from Doppler key MAX_RETRIES"
  sensitive = false
  default = 3
}

variable "allowed_origins" {
  type = list(string)
  description = "Imported from Doppler key ALLOWED_ORIGINS"
  sensitive = false
  default = [
  "https://app.example.com",
  "https://admin.example.com"
]
}

resources.tf

Doppler provider starter config and per-secret resource stubs.

terraform {
  required_providers {
    doppler = {
      source = "DopplerHQ/doppler"
    }
  }
}

provider "doppler" {}

locals {
  doppler_secrets = {
    "STRIPE_SECRET_KEY" = var.stripe_secret_key
    "NEXT_PUBLIC_API_BASE_URL" = var.next_public_api_base_url
    "FEATURE_FLAG_BETA" = var.feature_flag_beta
    "MAX_RETRIES" = var.max_retries
    "ALLOWED_ORIGINS" = var.allowed_origins
  }
}

resource "doppler_secret" "stripe_secret_key" {
  project = var.doppler_project
  config  = var.doppler_config
  name    = "STRIPE_SECRET_KEY"
  value   = try(tostring(local.doppler_secrets["STRIPE_SECRET_KEY"]), jsonencode(local.doppler_secrets["STRIPE_SECRET_KEY"]))
}

resource "doppler_secret" "next_public_api_base_url" {
  project = var.doppler_project
  config  = var.doppler_config
  name    = "NEXT_PUBLIC_API_BASE_URL"
  value   = try(tostring(local.doppler_secrets["NEXT_PUBLIC_API_BASE_URL"]), jsonencode(local.doppler_secrets["NEXT_PUBLIC_API_BASE_URL"]))
}

resource "doppler_secret" "feature_flag_beta" {
  project = var.doppler_project
  config  = var.doppler_config
  name    = "FEATURE_FLAG_BETA"
  value   = try(tostring(local.doppler_secrets["FEATURE_FLAG_BETA"]), jsonencode(local.doppler_secrets["FEATURE_FLAG_BETA"]))
}

resource "doppler_secret" "max_retries" {
  project = var.doppler_project
  config  = var.doppler_config
  name    = "MAX_RETRIES"
  value   = try(tostring(local.doppler_secrets["MAX_RETRIES"]), jsonencode(local.doppler_secrets["MAX_RETRIES"]))
}

resource "doppler_secret" "allowed_origins" {
  project = var.doppler_project
  config  = var.doppler_config
  name    = "ALLOWED_ORIGINS"
  value   = try(tostring(local.doppler_secrets["ALLOWED_ORIGINS"]), jsonencode(local.doppler_secrets["ALLOWED_ORIGINS"]))
}

terraform.tfvars.json

Quick copy block for local testing or module inputs.

{
  "stripe_secret_key": "sk_live_xxx",
  "next_public_api_base_url": "https://api.example.com",
  "feature_flag_beta": true,
  "max_retries": 3,
  "allowed_origins": [
    "https://app.example.com",
    "https://admin.example.com"
  ]
}