Page tree
Skip to end of metadata
Go to start of metadata

You can use environment variables to pass parameters and credentials to the custom script using _env. See Workflow Secret Management for information about how to use workflow secrets.

TD_API_KEY: ${secret:apikey}
TD_API_SERVER: ${secret:endpoint}
AWS_ACCESS_KEY_ID: ${secret:aws_access_key_id}
AWS_SECRET_ACCESS_KEY: ${secret:aws_secret_access_key}

To add a workflow secret to your custom script:

  1. Declare the secret in your workflow definition (.dig file) custom script declaration. For example:

      py>: my_script.value_test
        saved_value: ${secret:saved_value}
        image: "digdag/digdag-python:3.7"

  2. Access the secret from your custom script using the `os.environ.get` method.

  3. Add it within your script. For example:

import digdag
import os
import io

def value_test():

  • No labels