Data
You can define custom properties by using the data property. The properties specified in a stack group configuration are available in its children's and stack's configuration files and stack templates files.

Example

If you specify data in a stack configuration file like this:
1
data:
2
subnets:
3
- subnet-ccbbb18ac981dc554e
4
- subnet-969b3de3fa0a275d9b
5
- subnet-7609598000b229fcb3
6
environment:
7
name: dev
8
code: 123
Copied!
Then, you can refer to the properties in the stack template file like so:
1
Resources:
2
Bucket:
3
Type: AWS::S3::Bucket
4
Properties:
5
Tags:
6
- Key: Environment
7
Value: {{ stack.data.environment.name }}
8
- Key: Code
9
Value: {{ stack.data.environment.code }}
Copied!

Where to define

The data property can be defined in stack and stack group configuration files. If specified in a stack group, the stack group's children and stacks inherit the value. Takomo merges the properties defined by stack groups and stacks to the properties they inherit from their parents.

Requirements

The data property must satisfy these requirements:
  • Must be an object
Last modified 10mo ago
Export as PDF
Copy link