#4829·terragrunt

Error with "Unapplied dependency and mock outputs"

Author: lopterCreated Sep 12, 2025Updated Sep 15, 2026
Labelsbugpreservedneeds-repro

Describe the bug

I have an implicit stack with two root modules: k8s-cluster and observability:

$ ls -l k8s-cluster/terragrunt.hcl # is an empty file
-rw-r--r-- 1 foo foo 0 Sep  4 20:54 k8s-cluster/terragrunt.hcl

$ cat observability/terragrunt.hcl 
dependency "k8s_cluster" {
  config_path = "../k8s-cluster"

  mock_outputs = {
    state_id = "foobar"

    api_endpoints = {
      public_endpoint = "127.0.0.1:6443"
    }

    ca_cert = <<-EOF
    LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSU5vdEFDZXJ0aWZpY2F0ZT09Ci0tLS0tRU5E
    IENFUlRJRklDQVRFLS0tLS0K
    EOF

    vcn_id = "ocid1.vcn.oc1.phx.mock-vcn-id"
    vcn_nat_route_table_id = "ocid1.routetable.oc1.phx.mock-route-table-id"
    vcn_worker_nsg_id = "ocid1.networksecuritygroup.oc1.phx.mock-worker-nsg-id"
    vcn_operator_nsg_id = "ocid1.networksecuritygroup.oc1.phx.mock-operator-nsg-id"
    vcn_bastion_nsg_id = "ocid1.networksecuritygroup.oc1.phx.mock-bastion-nsg-id"
  }
}

inputs = {
  k8s_state_id = dependency.k8s_cluster.outputs.state_id

  k8s_cluster_public_api_endpoint = "https://${dependency.k8s_cluster.outputs.api_endpoints.public_endpoint}"
  k8s_cluster_ca_cert = base64decode(dependency.k8s_cluster.outputs.ca_cert)

  k8s_vcn_id = dependency.k8s_cluster.outputs.vcn_id
  k8s_vcn_nat_route_table_id = dependency.k8s_cluster.outputs.vcn_nat_route_table_id
  k8s_vcn_workers_nsg_id = dependency.k8s_cluster.outputs.vcn_worker_nsg_id
  k8s_vcn_operator_nsg_id = dependency.k8s_cluster.outputs.vcn_operator_nsg_id
  k8s_vcn_bastion_nsg_id = dependency.k8s_cluster.outputs.vcn_bastion_nsg_id
}

$ 

When I run terragrunt run --all validate or plan from the folder containing k8s-cluster and observability I am getting this unexpected error:

$ terragrunt run --all validate
18:27:16.399 INFO   The runner at . will be processed in the following order for command validate:
Group 1
- Unit ./k8s-cluster

Group 2
- Unit ./observability


18:27:17.166 STDOUT [k8s-cluster] tofu: Success! The configuration is valid.
18:27:17.699 ERROR  [observability] Error: Unsupported attribute
18:27:17.699 ERROR  [observability]   on ./observability/terragrunt.hcl line 25:
18:27:17.699 ERROR  [observability]   25:   k8s_state_id = dependency.k8s_cluster.outputs.state_id
18:27:17.699 ERROR  [observability] This object does not have an attribute named "state_id".
18:27:17.699 ERROR  [observability] Error: Unsupported attribute
18:27:17.699 ERROR  [observability]   on ./observability/terragrunt.hcl line 30:
18:27:17.699 ERROR  [observability]   30:   k8s_vcn_id = dependency.k8s_cluster.outputs.vcn_id
18:27:17.699 ERROR  [observability] This object does not have an attribute named "vcn_id".
18:27:17.699 ERROR  [observability] Error: Unsupported attribute
18:27:17.699 ERROR  [observability]   on ./observability/terragrunt.hcl line 31:
18:27:17.699 ERROR  [observability]   31:   k8s_vcn_nat_route_table_id = dependency.k8s_cluster.outputs.vcn_nat_route_table_id
18:27:17.699 ERROR  [observability] This object does not have an attribute named "vcn_nat_route_table_id".
18:27:17.699 ERROR  [observability] Error: Unsupported attribute
18:27:17.699 ERROR  [observability]   on ./observability/terragrunt.hcl line 32:
18:27:17.699 ERROR  [observability]   32:   k8s_vcn_workers_nsg_id = dependency.k8s_cluster.outputs.vcn_worker_nsg_id
18:27:17.699 ERROR  [observability] This object does not have an attribute named "vcn_worker_nsg_id".
18:27:17.699 ERROR  [observability] Error: Unsupported attribute
18:27:17.699 ERROR  [observability]   on ./observability/terragrunt.hcl line 33:
18:27:17.699 ERROR  [observability]   33:   k8s_vcn_operator_nsg_id = dependency.k8s_cluster.outputs.vcn_operator_nsg_id
18:27:17.699 ERROR  [observability] This object does not have an attribute named "vcn_operator_nsg_id".
18:27:17.699 ERROR  [observability] Error: Unsupported attribute
18:27:17.699 ERROR  [observability]   on ./observability/terragrunt.hcl line 34:
18:27:17.699 ERROR  [observability]   34:   k8s_vcn_bastion_nsg_id = dependency.k8s_cluster.outputs.vcn_bastion_nsg_id
18:27:17.700 ERROR  [observability] This object does not have an attribute named "vcn_bastion_nsg_id".
18:27:17.700 ERROR  [observability] Unit ./observability has finished with an error
18:27:17.700 ERROR  Run failed: error occurred:

* ./observability/terragrunt.hcl:25,48-57: Unsupported attribute; This object does not have an attribute named "state_id"., and 5 other diagnostic(s)

$

All those outputs from k8s-cluster haven't been applied yet, they are properly defined though:

$ cat k8s-cluster/outputs.tf 
output "api_endpoints" {
  description = "A map with different kinds of endpoints to reach the K8s API"
  value       = module.oke.cluster_endpoints
}

output "ca_cert" {
  description = "The CA certificate in use on the K8s API"
  value       = module.oke.cluster_ca_cert
}

output "vcn_id" {
  description = "The id of the VCN of the K8s cluster"
  value       = module.oke.vcn_id
}

output "vcn_nat_route_table_id" {
  description = "The id of the NAT routing table to allow a private subnet to egress to the Internet"
  value       = module.oke.nat_route_table_id
}

output "vcn_workers_nsg_id" {
  description = "The id of the Network Security Group of the worker nodes"
  value       = module.oke.worker_nsg_id
}

output "vcn_operator_nsg_id" {
  description = "The id of the Network Security Group of the operator nodes"
  value       = module.oke.operator_nsg_id
}

output "vcn_bastion_nsg_id" {
  description = "The id of the Network Security Group of the bastion nodes"
  value       = module.oke.bastion_nsg_id
}

output "state_id" {
  description = "A randomly generated id to identify resources from this particular \"instance\""
  value       = module.oke.state_id
}

$ 

A terragrunt plan from the k8s-cluster properly shows that those outputs would be populated.

Expected behavior

As documented?

Versions

  • Terragrunt version: v0.86.0
  • OpenTofu/Terraform version: OpenTofu v1.10.6
  • Environment details (Ubuntu 20.04, Windows 10, etc.): linux_amd64 / NixOS unstable.

Additional context

I am happy to run terragrunt in delve with debug symbols, if you help me navigate the code base a bit. I am kalessin14 on discord fwiw.