gruntwork-io/terragrunt-infrastructure-live-example

[QUESTION] Multi region deployment

Closed this issue · 3 comments

I'm using Terragrunt and it is amazing. This repo was very useful indeed when setting up my own.

That being said, I got confused by one particular design choice. Considering the tree below:

prod/
├── terragrunt.hcl
└── us-east-1/
    └── prod/
        ├── mysql/
        │   └── terragrunt.hcl
        └── webserver-cluster/
            └── terragrunt.hcl

And the fact the region is defined one folder level above us-east-1

inputs = {
  aws_region = "us-east-1"
}

I started wondering what would happen if two regions were to be used and how to go about duplicating the structure while maintaining the DRY aspect of Terragrunt.

The first thing I wondered was if I could add a 3-line terragrunt.hcl under prod/us-east-1 that would only define inputs.aws_region, but given the fact find_in_parent_folders() gets the very first file it finds, that would never work...

From my point of view, the current way to duplicate a region would just to duplicate the first level prod folder all the way down to every module, but nevertheless I do think having multiple aws_region variables under different prod/some-region folders don't solve the whole problem either...

I guess the question per se is how to go about a multi-region deployment. Since I fail to see a good enough solution, how does Terragrunt solves it? :)

To do multi region, you duplicate the folder structure from prod/<region> on down. The settings and even services in each region are often a bit different, so this is fairly unavoidable.

What settings and services are different?

The answer is to stop using terragrunt. Terragrunt doesn't solve the multi-region problem. It just duplicates ALL the terragrunt code. Which is a terrible solution.