Local configuration
Configure resources and configs to use locally.
The context in which tasks and views are executed locally can be customized through local
resources, config variables, and environment variables.
This configuration is managed via the Studio UI and persisted to an
airplane.dev.yaml
file.If your local config file contains sensitive information such as production credentials, do not
share the file or check it into source control, as the contents of the dev config file are not
encrypted. You may instead want to share it by using a password manager or secure file exchange
platform.
For more information on the file format, see the
airplane.dev.yaml
reference.Resources
Resources
A common use case for local development of tasks is to hit a local resource, e.g. a database that's
running locally.
Add a resource
Add a resource
In order to add a new resource, first start the local dev server, as outlined in
Starting the studio. Then, select the resources tab on the
left sidebar and click the
+
icon:
The left sidebar will show a list of available resource types, similar to what you might see when
creating an Airplane resource in production:

After selecting a resource type, you'll be prompted to fill in the configuration for that resource:

Click
Create
, and your resource will be saved to the dev config file!Config variables
Config variables
Tasks utilize config variables via environment variables
and config attachments. For example, consider a task that
has the environment variable
STRIPE_API_KEY
that references config variable API_KEY
. When this
task runs, the environment variable STRIPE_API_KEY
will be set to the value of the API_KEY
config variable.yamlCopied1// example.task.yaml2slug: example3envVars:4STRIPE_API_KEY:5config: API_KEY
Add a config variable
Add a config variable
To add a config variable to the dev config file, select the configs tab on the sidebar and click the
+
icon:
Fill in the name and value of the config variable, and click
Create
— your new config variable
should show up in the config variable listing:
Environment variables
Environment variables
You can specify Studio-wide environment variables. These environment variables override any
environment variables specified in your task or view definitions. For example, suppose that we have
the following dev configuration file:
yamlCopied1// airplane.dev.yaml2envVars:3MY_ENV_VAR: bar
And the following task definition:
yamlCopied1// example.task.yaml2slug: example3envVars:4MY_ENV_VAR: foo
When the task is executed, the environment variable
MY_ENV_VAR
will be set as bar
, not foo
.Add an environment variable
Add an environment variable
To add an environment variable to the dev config file, select the environment variables tab on the
sidebar and click the
+
icon:
Fill in the name and value of the environment variable, and click
Create
— your new environment
variable should show up in the environment variable listing:
Managing dev config file from the CLI
Managing dev config file from the CLI
While the UI-based approach above is recommended, it's possible to add, update, and delete both
resources and configs using the CLI. To do so, we've included a set of
airplane dev config
subcommands in the CLI to assist in modifying the dev config file, outlined below.Add or update a resource
Add or update a resource
Copied1$ airplane dev config set-resource2? What's the slug of your resource? This should match the <alias>: <slug> entry in your resource attachments. my_db3? What's the name of your resource? This should be a human-readable name for your resource. My database4? What's your resource kind? Available kinds:5- bigquery6- mailgun7- mongodb8- mysql9- postgres10- redshift11- rest12- sendgrid13- slack14- smtp15- snowflake16- sqlserver17> postgres18? Enter postgres resource `username`: postgres19? Enter postgres resource `host`: localhost20? Enter postgres resource `port`: 543221? Enter postgres resource `database`: postgres22? Enter postgres resource `password`: password23? Enter postgres resource `ssl`: disable24? Enter postgres resource `dsn`:25? Enter postgres resource `sshHost`:26? Enter postgres resource `sshPort`:27? Enter postgres resource `sshUsername`:28? Enter postgres resource `sshPrivateKey`:29Successfully wrote resource `my_db` of kind `postgres` to dev config file.
Delete a resource
Delete a resource
Copied1$ airplane dev config delete-resource my_database2Removed resource with slug my_database from dev config file, if it existed.
Add or update a config variable
Add or update a config variable
Copied1$ airplane dev config set-configvar API_KEY=test2Successfully wrote config variable "API_KEY" to dev config file.
Delete a config variable
Delete a config variable
Copied1$ airplane dev config delete-configvar API_KEY2Deleted config variable "API_KEY" from dev config file.
Reference
Reference
See the
airplane.dev.yaml
reference for more information.