One Terragrunt Root Block Can Enforce a Default AWS Region Across All Modules
In large multi-module Terragrunt setups, AWS region is typically declared manually in each module's project.hcl file, creating a silent risk of misconfiguration when modules are copied and regions go unchecked. A developer has shared a pattern where the root.hcl file uses Terragrunt's try() function to apply an organisation-wide default region, falling back to it whenever a module does not explicitly override the value. Under this approach, new modules automatically deploy to the correct region without any extra configuration, while deliberate regional exceptions must be written out explicitly — making deviations visible and intentional. The technique shifts the burden of proof: instead of every module needing to get the region right, only modules that genuinely differ from the default need to declare anything. The author notes the same pattern can be applied to other shared settings such as default tags, VPC configuration, and log retention policies.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in