Skip to content


Configure client library with Banyan credentials.

configure(user_id=nothing, api_key=nothing, ec2_key_pair_name=nothing, require_ec2_key_pair_name=false)


This function configures Banyan Julia to use your Banyan credentials.

It looks for configuration information in three places in the following order of precedence.

  1. Function arguments (e.g., configure(...))
  2. Environment variables. (e.g., BANYAN_USER_ID and BANYAN_API_KEY)
  3. Configuration (config) file located at $HOME/.banyan/banyanconfig.toml

Regardless of how the configuration is specified, after this function is called, a configuration (config) file is created at the location $HOME/.banyan/banyanconfig.toml where $HOME is the home directory of the machine where the Banyan Julia client library is being run. The configuration file should be in the following format:

ec2_key_pair_name = "MySSHKeyPair"
region = "us-west-2"

api_key = "1234567890abcdefghijklmnopqrstuv"
user_id = "98876543210zyxwvutsrqponmlkjihgf"

After calling this function once, your credentials will be saved in the configuration file and the saved credentials will be used from then onwards. To update the saved credentials, simply call the configure function again.

Optional Parameters

All these parameters are optional because if no parameters are specified, either environment variables or the configuration file at $HOME/.banyan/banyanconfig.toml will be used (as specified above).


Banyan User Id for user. Can be found on the "Account" page of the Banyan dashboard.

api_key (String)

Banyan API Key for user. Can be found on the "Account" page of the Banyan dashboard.

ec2_key_pair_name (String)

Name of the AWS EC2 Key Pair that should be used when creating a cluster. The key pair file can be used to SSH into the cluster, once it is created.

require_ec2_key_pair_name (Bool)

Validate that an ec2_key_pair_name has been provided in the configuration. This is useful when, for example, configuring the client before creating a cluster, since an ec2_key_pair_name is required for cluster creation. Defaults to false

Returns (Dict)

Banyan config dictionary, containing the latest configuration.

    "banyan" => Dict(
        "user_id" => "98876543210zyxwvutsrqponmlkjihgf",
        "api_key" => "1234567890abcdefghijklmnopqrstuv"
    "aws" => Dict(
        "ec2_key_pair_name" => "MySSHKeyPair",
        "region" => "us-west-2"

Example Usage

# To authenticate using environment variables and banyanconfig.toml

# To authenticate using given User ID and API Key
configure("user_id"="98876543210zyxwvutsrqponmlkjihgf", "api_key"="1234567890abcdefghijklmnopqrstuv")