Complete terragrunt toolkit with generation and validation capabilities
93
93%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Advisory
Suggest reviewing before use
Symptom: Error: Attempt to get attribute from null value in root.hcl
Cause: Root.hcl is trying to read env.hcl via find_in_parent_folders("env.hcl"), but env.hcl doesn't exist at the root level.
Solution: Make root.hcl environment-agnostic:
# DON'T do this in root.hcl for multi-environment setups:
locals {
env_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) # FAILS
}
# DO use static values or get_env():
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
provider "aws" {
region = "us-east-1" # Or: get_env("AWS_REGION", "us-east-1")
}
EOF
}Symptom: Error: Duplicate required providers configuration
Solutions:
Remove conflicting generate block — Only generate provider "aws", not required_providers, when using registry modules:
generate "provider" {
path = "provider.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
provider "aws" {
region = "us-east-1"
}
EOF
}Use if_exists = "skip" — Skip generation if the file already exists:
generate "versions" {
path = "versions.tf"
if_exists = "skip"
contents = "..."
}Clear cache if conflicts persist:
rm -rf .terragrunt-cache && terragrunt initSymptom: Unknown variable; There is no variable named "local" in feature blocks
Cause: Feature flag defaults must be static values, not references to locals or variables.
Solution: Ensure defaults are static values (see Feature Flags section in SKILL.md).
Symptom: Error: Attempt to get attribute from null value in a child module
Cause: Child module is trying to read env.hcl but the file doesn't exist in the environment directory.
Solution: Ensure env.hcl exists in the environment directory:
dev/
├── env.hcl # MUST exist
└── vpc/
└── terragrunt.hcl # Calls find_in_parent_folders("env.hcl")