Back to all blog posts
Guide

Terramate v0.4.3 — Deep Cloning for Stacks

One of the most requested features for Terramate CLI was to enable deep cloning for stacks in Terramate using the clone command. You can now use the clone command to clone nested stacks or, in other words, entire environments.

Picture of Soren Martius
Sören Martius
· 2 min read
Terramate v0.4.3 — Deep Cloning for Stacks

Introduction

It’s been some time since we published our last update on Terramate CLI. Many things have happened in the meantime, and guess what? Terramate Cloud is about to launch since we took the past couple of months to shape the product with our design partners and early users.

If you are interested in learning about Terramate Cloud and getting early access, please fill out the application form at https://terramate.typeform.com/to/xwh2DLDr

New Features in Terramate CLI

Deep Cloning of Stacks

One of the most requested features for Terramate CLI was to enable deep cloning for stacks in Terramate using the clone command. You can now use the clone command to clone nested stacks or, in other words, entire environments.

Imagine you develop a new service in staging that you want to roll out to production. Instead of manually copying and pasting a bunch of stacks, updating stack properties such as IDs, etc., clone now does this for you automatically.

Often, users use the stack.id property to get a stack's ID to use in the Terramate Code Generation (The stack.id property defaults to a randomly generated UUIDv4 if not defined differently by the user). One use case is prefixing a state path for the generated Terraform Backend definitions. The clone command will automatically update the UUID for all cloned stacks and trigger the code generation.

This will save developers a ton of time in the future when cloning stacks and nested stacks in Terramate projects.

Using Glob in imports

Previously, to import a bunch of Terramate files, users needed to declare one import statement per import.

import {
  source = "/more/globals.tm.hcl"
}
import {
  source = "/more/settings.tm.hcl"
}

This approach didn’t scale for mid to large scale Terramate projects which led us to implement glob imports. You can now simply import all files in a specific directory instead of listing each files explicitly.

import {
    source = "/imports/*.tm.hcl"
}

Outlook

We continue investing in Terramate to become the best IaC tooling in the market. To mention some of the major features that we will ship during the next few weeks:

  • Terramate Scripts to allow users to specify a recurring sequence of commands to execute for e.g. a Deployment including specifying specific options especially set for the cloud.
  • Globals v2 to significantly improve the performance of Globals and to add missing functionality such as deep merging of lists.
  • Full Docker Support for Terramate and the change detection.
  • Terramate Projects to allow users to manage multiple projects with different or same configurations within the same repository.

In addition, we keep adding more functionality to integrate Terramate CLI seamlessly with the upcoming Terramate Cloud. As always, for a complete overview of changes please consider the changelog.

Join the Community

Your feedback is very valuable for us and the future development of Terramate. We’d love you to join our Discord Community which is the best way to give us feedback or to ask questions regarding Terramate. Only with your feedback we can continue building the best Terraform tooling in the industry.

Soren is a co-founder and Chief Product Officer of Terramate. Before founding Terramate, he built cloud platforms for some of Europe's fastest-growing scaleups.