Skip to content
simcap edited this page May 18, 2018 · 5 revisions

Code is the truth and uncompiled documentation is a guy chasing the truth.

Anyway the following will help you understand how the awless code is organized and to locate things more easily.

Importantly, do not see the current implementation of awless or what is described below as the definite and permanent. Things can be bettered, moved, reduced, simplified and there is plenty of room for improvement (as long as it is test driven ;) )

Template processing

Let's say you issue the cloud command create instance name=redis-prod either from the CLI (i.e. awless create instance name=redis-prod) or from running a template file containing the actual line. Both end up being processing the same way.

  • Lexing, parsing and AST representation of this line starts in template/parser.go that uses template/internal/ast

  • Compilation and passes made on the AST: template/compile.go

  • template/params define all the abstract logic and interfaces to bridge between AWS cloud specs (i.e. drivers) and the compiler.

  • template/env will define the interfaces for the a template's compile environment and a template's running environment. This is where you can

  • template/runner.go allows you to wraps context and hooks around a template run.

  • The template runner will then delegate at some point to template/template.go where the actual corresponding cloud specs (i.e. AWS drivers) are retrieved, loaded and executed.

Clone this wiki locally