Variables Layering


Given a blueprint named demo and the following vars directory structure:

├── base.rb
├── dev.rb
└── prod.rb
  • base.rb is always evaluated.
  • dev.rb or prod.rb is evaluated based on LONO_ENV.

The base.rb params are always used, and prod.rb provides overrides. We can use different autoscaling group min and max size for dev and prod like so.


@min_size = 1
@max_size = 1


@min_size = 10
@max_size = 20

Lono will use the @max_size = 20 variable value with LONO_ENV=prod. Lono will use @max_size = 1 for all other LONO_ENV values. Example:

LONO_ENV=dev  lono up demo # @max_size = 1
LONO_ENV=prod lono up demo # @max_size = 20

Remember, variables affect templates at compile-time. Here’s the lifecycle flow to see when the compile phase happens.

Stack Created