Tutorial EC2: Project Structure
lono new command set up a lono project structure to help you know where things go. For a brand new project, most of the folders are still empty.
$ tree autoscaling autoscaling ├── app │ ├── definitions │ │ └── base.rb │ ├── helpers │ ├── partials │ ├── scripts │ ├── templates │ └── user_data ├── config │ ├── params │ ├── settings.yml │ └── variables └── output $
Here’s an overview of the directory structure and the purpose of each folder:
|File / Directory||Description|
|app/definitions||Here’s where you define or declare your template definitions. It tells lono what templates to generate to the
|app/helpers||Define your custom helpers here. The custom helpers are made available to
|app/partials||Where templates partials go. You can split up the CloudFormation templates into erb partials. Include them with the
|app/scripts||Where your custom scripts go. Scripts in this folder get uploaded to s3 as a tarball during the
|app/user_data||Where you place your scripts meant to be used for user-data. Include them in your templates with the
|config/params||Where you specific your run-time parameters for the CloudFormation stacks. Params files have access to shared variables and helpers also. The params are automatically layered together based on
|config/variables||This is where your shared variables that made are available
|output||This is where the generated files like CloudFormation templates and parameter files are written to. These files can be used with the raw
That hopefully gives you a basic idea for the lono directory structure.
The Folders Overview above might be a little bit much if is your first time looking at the full lono project structure. A new project has most of the folders empty though. They are only needed if you use them. In the next section, we’ll start to fill out some of the folders by importing an EC2 template.
Pro tip: Use the <- and -> arrow keys to move back and forward.