#4829·terragrunt

"未应用的依赖项和模拟输出"错误

作者: lopter创建于 2025年9月12日更新于 2026年9月15日
标签bugpreservedneeds-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
}
$

内容来源: gruntwork-io/terragrunt