Config variables
Managing config vars
To manage config vars, you must be a Team Admin. If you're a Team Admin, you can manage them from the Settings section of the app.
Config vars have a name and an associated string value. Config vars can be secret, in which case the value can be set but will not be exposed to users from the UI. All config vars on Airplane are stored encrypted at rest.
Config var names are flexible, but we recommend the following conventions:
db
: for simple names use lowercase, one wordeng/platform/db
: use slashes to group your config vars togetherdb:stage
: use a colon to append a tag to your config var name—use tags for different variants of a config var (e.g. staging/production). Tags don't have special behavior currently but may get extra features in the future.
Using config vars in tasks
You can pass in a config var to a task in one of two ways: config attachments and environment variables.
Config attachments
For SQL and REST tasks, you can use configs by attaching them to the task and referencing them in a JavaScript template.
In your task definition file (the file with extension .task.yaml
):
yamlCopied1rest:2configs:3# Where API_KEY is the name of a config var created in the web UI.4- API_KEY5headers:6X-API-KEY: "{{configs.API_KEY}}"
When creating a task, select the configs that you'd like to attach to the task:

The configs can then be referenced in any templated field in the UI:

Environment variables
For all other task types, you can utilize configs by creating environment variables that are populated from config variables.
In your task definition file (the file with extension .task.yaml
):
yamlCopied1node:2envVars:3SENDGRID_API_KEY:4# Where sendgrid_api_key is the name of a config var created in the web UI.5config: sendgrid_api_key
Expand the Advanced section, and find the Environment Variables section. Choose
From config variable
to assign a config var's value to the specified environment variable:

This will pass the config var into the task as an environment variable. Access environment variables in your script using standard patterns:
javascriptCopied1const apiKey = process.env.SENDGRID_API_KEY;
pythonCopied1api_key = os.getenv('SENDGRID_API_KEY')
bashCopied1api_key=$SENDGRID_API_KEY