Part 05 — Release Strategy

Vighnesh Prakash
3 min readMar 9, 2023

--

Creating Terraform modules can be a complex and time-consuming process. From developing the module code to testing it and documenting it, there are numerous steps that go into building a high-quality module. But what happens after the module is complete?

In the previous articles, we saw how to document and publish our terraform modules. Publishing is the last stage of the Release Strategy. There are a few things that happen before it.

In this article, I want to cover the release strategy I use for my terraform modules.

Release Branches

I use release branches with Gitlab Flow to manage the release process.

The release process begins with the creation of a release branch from the main branch. The release branch strictly adheres to semantic versioning.
(eg: release/0.0.1)

As soon as a release branch is created, the release pipeline kicks in. The release job executes Gitlab’s release CLI to generate a tag and create a release snapshot.

The Release Job
Release Pipeline
Release Jobs
Release aka Repo Snapshot
Tag Generated by the Release Job
Tag 0.0.1 with contents of Readme.md populated
Terraform Module Published to Gitlab registry
Published package

Conclusion

The release job plays an important part in your terraform module’s lifecycle. As you add more functionalities to your terraform module, the readme file is also bound to change. By generating a snapshot of your repository and also tagging your code, every released version will always have its equivalent documentation in your GitLab repository.

--

--