Doppler Terraform provider on terraform cloud

Hi There!

I’m trying to setup doppler to inject secrets as terraform variables into my terraform cloud runner. I have added the doppler provider and successfully injected the token via the TF cloud variables GUI. I’m now looking to use the these doppler secrets as variables with other providers. I’m a bit new to terraform but I have successfully provisioned some AWS infra with it so I’m familiar with how it should be working when you inject the secrets via terraform variables in TF cloud web GUI.

Hi Jonathan!

Welcome to the Doppler Community!

If you’re using the Doppler Terraform Provider, then you should be able to reference your secrets directly in your Terraform code. The project and config that’s being used is determined by the token you provide (navigate to the Access tab under the config of the project you want to pull secrets from to generate a token). From there you just create a doppler_secrets data source:

# Define our data source to fetch secrets
data "doppler_secrets" "this" {}

That data source exposes a read-only map that will have all the secrets for the specified config. You can reference them throughout your Terraform code as follows:

data.doppler_secrets.this.map.STRIPE_KEY

Are you already doing that and encountering problems? I’m not super familiar with Terraform Cloud, so if you could provide some screenshots (be sure to redact anything sensitive!) showing what problems you’re having, that would be helpful!

Thanks!
-Joel