Template
You put CloudFormation template files for stacks in the templates directory or its subdirectories.
For each stack, you specify the template file to use with the
template
property. It accepts a relative file path to the template file in the templates directory.If you don't specify the template, Takomo looks for a template file using the relative file path to the current stack configuration file from the stacks directory.
Takomo supports both of the standard CloudFormation template file formats, i.e., JSON and YAML.
Say, we have the following project.
.
├─ stacks
│ └─ application.yml
└─ templates
└─ application-template.yml
In application.yml stack configuration file you can define the
template
property like so:stacks/application.yml
template: application-template.yml
If you would omit the
template
property, Takomo would fallback to the default behaviour and look for a template file by name application.yml from the templates directory.You can also inline the template body in a stack configuration file.
template:
inline: |
Resources:
VPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
By default, Takomo processes each template file with Handlebars templating engine. You can turn off this dynamic template processing by providing the template configuration with an object with two properties:
filename
and dynamic
. The former specifies the relative file path to the template file in the templates directory., and the latter is an optional boolean to enable or disable dynamic processing.Use the object notation to disable dynamic template:
template:
filename: networking.yml
dynamic: false
The
template
property can be defined only in stack configuration files.The
template
property must satisfy these requirements:- Must be a string or an object
Last modified 2yr ago