docs-terraform-guidelines

Terragrunt ADR

Issue

We have been using Terraform to configure our infrastructures at scale. We started facing issues maintaining and onboarding newcomerss to a code base. The WYSIWYG pattern helped keep common practices between code bases, but it also has limitation : you need to duplicate code (Modules, resources and data) in order to scale your infrastructure. This increases complexity when creating new infrastructure because you need to understand every parameter of your modules. Thus module complexity tend to increase and refactoring becomes harder.

Decision

We have decided to adopt Terragrunt for creating infrastructure at scale.

Status

Decided

Assumptions

Constraints

Positions

Terraform

Vanilla Terraform does not allow you to keep your code DRY. The Deepmerge module from cloudpose can help you merge inputs, but it’s more of a hack than anything else.

Terragrunt

The context pattern explains ways around the issue and how Terragrunt help you have a DRY code base. It solves the issue with :

Terramate

Terramate looks like Terragrunt, but has less adoption inside the community.

Pulumi

We have looked into Pulumi because it uses common language like GO, typescript or Python, but it does not help solve the issue. Furthermore the solution is still a bit young and still base most of its provider on Terraform provider.

Argument

We chose Terragarunt because:

Implications