Pipedream

Learn how to inject Doppler secrets into your Pipedream steps.

Prerequisites

Service Token

To fetch secrets, a Doppler Service Token exposed as a DOPPLER_TOKEN environment variable is required which provides read-only access to a specific config.

Once you've created the Service Token in Doppler, go to Settings > Environment Variables in the Pipeline dashboard and create a new DOPPLER_TOKEN variable using the Service Token value.

Pipedream Secrets

The following examples show how to fetch secrets and export them for use in subsequent steps but you can delete the export statement if secrets are only required for a single step.

Node.js

import { providers } from 'gitops-secrets';

export default defineComponent({
  async run({ steps, $ }) {
    const secrets = await providers.doppler.fetch();
    $.export('secrets', secrets);
  },
})

Python

import os
from pipedream.script_helpers import (steps, export)
import requests

secrets = requests.get(
  'https://api.doppler.com/v3/configs/config/secrets/download?format=json', 
  auth=(os.environ['DOPPLER_TOKEN'], '')
).json()

export("secrets", secrets)

πŸ‘

Awesome Work!

Now you know how to inject Doppler secrets into your Pipedream steps.


Did this page help you?