When I started to use Terraform I ran into challenges with dependencies between projects and repeating terraform code. To get around these challenges I use Terragrunt.
Terragrunt is used to structure your Terraform infrastructure projects to support multiple environments(e.g. dev, test, production) without duplicating code.
This repository explores Terragrunt to address these challenges:
- How to define a standard directory structure for my projects that support different environments(e.g. dev, test, prod) while sharing common Terraform modules
- How to store a state file in a s3 bucket in a common location for multiple terraform projects
- How to lookup resources not in your Terraform projects state file
- How to control deployment to different environments when you update a common module
These standards are all used in my terragrunt-example project.