Terragrunt dependencies — automatic apply order based on dependencies.
dependency block:
1# infrastructure/production/eks/terragrunt.hcl2dependency "vpc" {3 config_path = "../vpc"4}56inputs = {7 vpc_id = dependency.vpc.outputs.vpc_id8 subnet_ids = dependency.vpc.outputs.private_subnet_ids9}
dependency outputs:
1# vpc/terragrunt.hcl outputs2output "vpc_id" {3 value = aws_vpc.main.id4}5output "private_subnet_ids" {6 value = aws_subnet.private[*].id7}
run-all (sequential apply):
1terragrunt run-all apply2# 1. vpc (no dependencies)3# 2. eks (depends on vpc)4# 3. apps (depends on eks)
mock outputs (for plan without apply):
1dependency "vpc" {2 config_path = "../vpc"3 mock_outputs = {4 vpc_id = "vpc-mock123"5 private_subnet_ids = ["subnet-mock1", "subnet-mock2"]6 }7 mock_outputs_allowed_terraform_commands = ["plan"]8}
Deploy order: vpc → eks → ingress → apps → monitoring.