Environment variables

Action-specific settings can be stored in environment variables. Since you can have multiple runbooks using the same action application, environment variables are great for storing values that are specific to an action instance (E.g. cluster names, specific queries, service names, IDs).

Environment variables are stored encrypted-at-rest.

You can define an environment variable schema at Settings > App Info > Environment variables schema. Environment variables values are set when you add an action to a runbook step.

Environment variable names must be strings (case-sensitive), with the following restrictions:

  • It can't be blank.
  • Its length can't exceed 30 characters.
  • It must be unique across the application (i.e., there can't be two environment variables in your application with the same name).
  • Only alphanumeric characters and the period, underscore and dash are allowed.
  • The first character may not be a numerical character or a dash.

Environment variable values can be any valid string, number, or boolean. There are no length or character restrictions. If left blank, they will default to null.

Programmatic interface #

Here is how you can access the environment variables for an action in your code:

env.get("stringKey")
// => "stringValue"
env.get("numberKey")
// => 88888
env.get("booleanKey")
// => True
env.get("unsetKey")
// => null
env.get("undefinedKey")
// => exception

Please see the Python operation documentation for information on programmatically accessing environment variables.