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
  • Variables
  • Comments
  • If-conditions
  • Iterating over collections

Was this helpful?

Export as PDF
  1. Variables and templating

Handlebars syntax

PreviousIntroductionNextEnvironment variables

Last updated 3 years ago

Was this helpful?

Here's a short guide to Handlebars syntax. For more information, consult the official Handlebars .

Variables

You refer to variables like this:

{{ variable_name }}

If the variable is an object with properties of its own, you can refer to them like so:

{{ person.firstName }}

This is how you refer to a specific index of an array:

{{ people.[0] }}

Comments

You can use Handlebars comments in your files. Commented out sections won't show up in the final rendered output.

{{! This comment will not show up in the output}}

If the content you want to comment out contains }} or other Handlebars tokens, you need to use different comment style:

{{!-- This comment may contain mustaches like }} --}}

If-conditions

Here's an example of if-condition:

{{#if some_variable}}
  this will be included in the output
{{/if}}

Iterating over collections

This is how you iterate over a collection of items:

{{#each securityGroupIds}}
  - {{this}}
{{/each}}
documentation