Dev config file
Define resource configuration and config variables for local development.
The development environment in which tasks are executed locally can be customized with a dev config
file. This file can be used to configure resources and set config variables.
By default, the airplane CLI will use a file called
airplane.dev.yaml
, and will traverse upwards
through any parent directories until this file is found. For all of the commands below, you can
add an optional flag --config-path
that tells the CLI where to look for a dev config file, and
any modifications will occur in that 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.
Resources
yamlCopied1# airplane.dev.yaml2resources:3- slug: db4name: My database5kind: postgres6host: localhost7port: "5432"8ssl: disable9username: postgres10password: password11database: postgres
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
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!Update a resource
Updating a resource is similar to adding one—simply select the resource from the left sidebar,
modify any fields, and click
Update
:
Delete a resource
To delete a resource from the dev config file, select the dropdown menu for that resource, and click
Delete
:
Config variables
Config variables are passed into your task via
environment variables or
config attachments.
yamlCopied1// airplane.dev.yaml2configVars:3API_KEY: 1234
In the above dev config file, we created a config variable with key
API_KEY
and value 1234
. In
our task definition file below, we created an environment variable MY_ENV_VAR
that references
config variable API_KEY
. When the task runs, the environment variable MY_ENV_VAR
will be set to
value 1234
.yamlCopied1// example.task.yaml2slug: example3envVars:4MY_ENV_VAR:5config: API_KEY
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:
Update a config variable
To update a config, click the
Edit
button next to the config you'd like to update, fill in the new
value, and click Update
:
Delete a config variable
To remove a config variable, click the
Edit
button of the config you'd like to remove, and click
Delete
:
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
Copied1airplane 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
Copied1airplane dev config delete-resource my_database2Removed resource with slug my_database from dev config file, if it existed.
Add or update a config variable
Copied1airplane dev config set-configvar API_KEY=test2Successfully wrote config variable "API_KEY" to dev config file.
Delete a config variable
Copied1airplane dev config delete-configvar API_KEY2Deleted config variable "API_KEY" from dev config file.
Reference
As shown above, you can modify your dev config file through the studio UI or CLI. However, you can
also modify your dev config file directly through your editor of choice. The following is a complete
reference of fields supported by the dev config file.
Resource
Resources are registered with the local dev server when developing a task
locally.
Top-level field that stores a list of resources.
yamlCopied1// airplane.dev.yaml2resources:3- slug: db4name: My database5kind: postgres6# The following fields are resource-specific.7host: localhost8port: "5432"9ssl: disable10username: postgres11password: password12database: postgres
Common fields
A unique identifier that is used to reference the resource in a task. This should match the slug
that's included in your resource
attachments.
A human-readable name for the resource.
The kind of the resource—for a complete list of resource kinds, see the Resource
page.
Resource-specific fields
For an exhaustive list of fields that a resource of a specific kind can support,
navigate to that resource's page.
Config variable
Config variables are referenced by environment variables and config attachments and are loaded into
the runtime when developing a task locally.
Top-level field that stores a map of config variables.
yamlCopied1// airplane.dev.yaml2configVars:3API_KEY: 12344<key>: <value>
The name of the config variable.
The value of the config variable.