Terragrunt dependency and mock_outputs
dependency block
Reads outputs from another Terragrunt unit - cleaner than terraform_remote_state and aware of the apply order.
# environments/prod/eks/terragrunt.hcl include "root" { path = find_in_parent_folders ( "root.hcl" ) }
dependency "vpc" { config_path = "../vpc" }
dependency "rds" { config_path = "../rds" }
inputs = { vpc_id = dependency . vpc . outputs . vpc_id private_subnets = dependency . vpc . outputs . private_subnet_ids db_endpoint = dependency . rds . outputs . endpoint }
mock_outputs
Without mock outputs, terragrunt plan fails if a dependency hasn't been applied yet - it can't fetch real outputs.…