Menu

Terragrunt dependency and mock_outputs

DEV Community: terraform·Bartłomiej Danek·7 months ago
#nNvNpRz9
#dev#class#code#highlight#dependency
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.