For each blueprint and CloudFormation template, you will usually need to setup some configs. Lono has a
lono seed command that generates starter configs values.
- The starter values for params are determined by the template definition itself.
- The starter values for variables are determined by the blueprint’s
seed/configs.rb, usually written by the author.
The general form is:
lono seed BLUEPRINT
Here’s an example using
$ lono seed ecs-asg Creating starter config files for ecs-asg Starter params created: configs/ecs-asg/params/development.txt $ cat configs/ecs-asg/params/development.txt # Required parameters: VpcId=vpc-111 Subnets=subnet-111,subnet-222,subnet-333 EcsCluster=development # Optional parameters: # InstanceType=m5.large # KeyName=... # SshLocation=... # TagName=ecs-asg $
configs/ecs-asg/params/development.txt file is conveniently generated for you. Depending on the blueprint, a
configs/ecs-asg/variables/development.rb will also be generated.
LONO_ENV will generate corresponding configs. For example,
LONO_ENV=production will generate
If you are authoring your own
seed/configs.rb, the general structure looks like this:
class Lono::Seed::Configs < Lono::Seed::Base # Template for variables def variables <<~EOL @variable1=value1 @variable2=value2 EOL end end
Remember to document how to use
lono seed in the README.md of your blueprint.
Pro tip: Use the <- and -> arrow keys to move back and forward.