Takomo
  • What is Takomo?
  • Getting started
    • Installation
    • Quick start
    • Tutorial
  • Configuration
    • AWS credentials
    • Directory structure
    • Stacks and stack groups
    • Project configuration
  • Stack properties
    • Name
    • Regions
    • Template
    • Template bucket
    • Command role
    • Account ids
    • Depends
    • Parameters
    • Tags
    • Inherit tags
    • Termination protection
    • Timeout
    • Capabilities
    • Stack policy
    • Ignore
    • Obsolete
    • Hooks
    • Data
    • Schemas
  • Variables and templating
    • Introduction
    • Handlebars syntax
    • Environment variables
    • Command-line variables
    • Partials
    • Helpers
    • Available variables
  • Parameter resolvers
    • Built-in parameter resolvers
      • Stack output resolver
      • External stack output resolver
      • Command resolver
      • File contents resolver
      • Hook output resolver
      • SSM parameter resolver
      • Secret resolver
    • Custom parameter resolvers
  • Hooks
    • Built-in hooks
    • Custom hooks
    • Sharing data between hooks
  • Validation schemas
    • Custom validation schemas
  • Command-line usage
    • Common options
    • Deploy stacks
    • Undeploy stacks
    • Prune stacks
    • List stacks
    • Detect drift
    • Generate IAM policies
    • Inspect stack configuration
    • Inspect stack dependencies
  • Support
    • Getting help
    • Troubleshooting
  • Development
    • Change log
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Variables and templating

Introduction

PreviousSchemasNextHandlebars syntax

Last updated 3 years ago

Was this helpful?

Sometimes static configuration files and templates are not enough to solve the real-life problems we might face. To help overcome those trickier challenges and avoid tedious and error-prone manual work, Takomo supports dynamic templating with .

All standard Handlebars features are available, which means you can use loops, if-conditions, partial includes, helpers, and variables to streamline your configuration.

By default, Takomo processes all stack configuration, stack group configuration, and stack template files using Handlebars.

You can turn off dynamic processing of stack template files by setting dynamic to false under the stack's property.

Understanding dynamic templating

It's essential to understand how dynamic templating works with Takomo. Takomo processes configuration files with Handlebars before parsing their content. The output produced by the processing needs to be a valid YAML document.

The YAML standard has some gotchas which may cause unexpected behaviour especially if you generate configuration files dynamically using Handlebars. It's helpful to set the logging level to trace when troubleshooting YAML-related problems.

Handlebars
template