Terragrunt Implementation for ADRA

Executive Summary

Terragrunt offers benefits such as code reusability, environment isolation, automatic dependency management, and simplified management of complex infrastructures. The migration plan consists of installing Terragrunt, refactoring Terraform code to be compatible with Terragrunt’s module structure, migrating state files, and testing and deploying the Terragrunt implementation. Following these steps, engineers can take advantage of Terragrunt’s powerful features and streamline their infrastructure management. That’s what the Matoffo team delivered to our client.

About the Customer

ADRA focuses on serving a humanitarian purpose all over the world. Building partnerships with numerous local organizations and communities, ADRA develops educational and healthcare programs to meet the needs of the local people who seek help.

Customer Challenge

Customer’s infrastructure has already been covered by Terraform configuration, but there were a lot of duplicates across three similar environments. When an engineer wanted to create additional infrastructure components, they needed to copy Terraform code configuration across all environments. As a result, engineers coped with misconfigurations and errors. Besides, it was a time consuming process for a client’s team.

To address this challenge, we worked closely with the customer to implement a more streamlined and efficient approach to Terraform configuration. We conducted a comprehensive review of the customer’s existing infrastructure and identified the areas where duplication could be eliminated and processes streamlined. Our team worked with the customer’s engineers to create a centralized Terraform configuration repository that could be easily accessed and updated by all team members.
By adopting this approach, we were able to significantly reduce the risk of misconfigurations and errors, while also streamlining the process of creating additional infrastructure components. The customer’s engineers were able to focus on developing new features and improving existing infrastructure, without being bogged down by time-consuming and error-prone configuration processes.

Why Terragrunt

Terragrunt provides a more streamlined, consistent, and efficient way to manage infrastructure code, enabling organizations to build and maintain infrastructure more easily and with fewer errors. By leveraging the benefits of Terragrunt, organizations can improve their infrastructure management processes and gain a competitive advantage in their industry.

Why Matoffo

The Matoffo team developed an efficient way to implement Terragrunt within a Terraform environment. Our engineers successfully streamlined the client’s infrastructure management. The client’s team struggled with numerous duplications caused by the Terraform configuration. We’ve developed a solution that allows the client’s team to dedicate more time to development. As a result of our work, they don’t face duplications and multiple errors in a code.

Matoffo Solution

Terragrunt is a powerful open-source tool that can greatly simplify the management of multiple Terraform modules in a single repository, while also providing a consistent workflow across teams and environments. For organizations striving to migrate from Terraform to Terragrunt, there are several basic steps that need to be followed to ensure a smooth and successful transition.

The first step is to install Terragrunt on your local machine or build environment. This can typically be done using a package manager or by downloading the binary from the Terragrunt website.

Once Terragrunt is installed, the next step is to refactor your existing Terraform code and make it compatible with Terragrunt’s module structure. This involves breaking your code into reusable modules, specifying inputs and outputs, and using Terragrunt-specific syntax. This process can take some time, but it is essential to ensure that your code works seamlessly with Terragrunt.

After your code is refactored, the next step is to migrate your Terraform state files to Terragrunt. This can be done using the “terragrunt state” command, which generates a state file that is compatible with Terragrunt. This process is important to ensure that your state files are properly integrated with your Terragrunt code.

Once your code is properly refactored and your state files are migrated, the next step is to thoroughly test your Terragrunt implementation and make sure it works as expected. This involves testing your code in a development or staging environment, and checking that all modules are properly isolated and that dependencies are managed correctly.

Finally, once your code has been fully tested, you can deploy it to your production environment. This involves running your Terragrunt code in your production environment, and monitoring the deployment to ensure that it runs smoothly.

By following these steps, we were able to successfully migrate our Terraform code to Terragrunt and take advantage of its effective features, such as automatic dependency management and environment isolation. If you are considering a migration from Terraform to Terragrunt, it is important to follow these basic steps to ensure a smooth and successful transition.


Amazon S3, RDS, Terraform, Gitlab CI, Application Load Balancer, Amazon ECS, CloudFront, Docker, ElastiCache, AWS CodeDeploy

Business Value

Terragrunt offers several advantages over Terraform that can provide significant business value for organizations. Here are the key benefits you can take from Terragrunt:

• Code reusability
Terragrunt enables code reusability, allowing you to define modules once and use them in multiple projects. This can greatly reduce duplication, increase consistency, and make it easier to maintain and update your infrastructure code.

• Multiple environments management
With Terragrunt, you can manage multiple environments with the same codebase, providing environment isolation and reducing the risk of errors. Terragrunt uses separate state files for each environment, which makes it easier to manage infrastructure changes across environments and ensures consistency.

• Automatic dependency management
Terragrunt ensures that dependent modules are applied in the correct order. This can greatly simplify the management of complex infrastructures with multiple dependencies and reduce the risk of errors.

In addition, Terragrunt simplifies the management of complex infrastructures by providing a higher-level abstraction layer over Terraform. This makes it easier to manage infrastructure code, reduce duplication, and enforce best practices, ultimately reducing complexity and increasing efficiency.


Our primary goal is to deliver value to our clients by resolving technical challenges and helping them achieve their objectives. We utilize cloud solutions as a powerful toolset to make this happen. With Matoffo expertise, companies can significantly reduce the time from idea to market and rapidly scale their digital business. Additionally, Matoffo enables seamless adoption of rapidly growing tech capabilities, transforming businesses to stay competitive in the market.

Tell us about your business needs

    I agree to periodically receive relevant information, news, and event notifications from Matoffo.

    Our website uses cookies to help personalize content and provide the best browsing experience possible. To learn more about how we use cookies, please read our Privacy Policy.