Open timblaktu opened 1 year ago
Hi,
I checked mentioned repository, outputs were attempted to fetch through dependency.region_data.availability_zone_names
, however, output variables are available in outputs
field: dependency.region_data.availability_zone_names
-> dependency.region_data.outputs.availability_zone_names
See more examples in: https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#dependency
I pushed the example code to repro the issue in this repo. It is a simplified project of mine that produces the primary error on
terragrunt run-all validate
:This is the oft-reported error-case of having not yet applied any of this infra yet, but my understanding is that validate is supposed to work in this case with mocked outputs. In fact, that's the prime use case for having mocked outputs. (Right?)
I feel I have tried all obvious permutations of specifying these paths in my .hcl files:
terraform.source
terraform.before_hook.execute
dependency.config_path
and using all various ways of specifying a path, e.g. for
modules/region/data
:a.
"../../..//modules/region/data"
b."${get_parent_terragrunt_dir()}//modules/region/data"
c."${get_terragrunt_dir()}" # I know this one's incorrect
I now always use the infamous double-slash in
terraform.source
, but the requirements around its placement is still quite fuzzy.What IS clear is that regardless of the source being local or remote, the
//
MUST be early enough in the path to enable terragrunt to copy from the correct node in the directory tree to provide all code needed to be referenced in the temp dir that it runs from.Bringing all these pieces and mocks together.. Although now that I'm:
//modules
so thatscript/before_hook.sh
and friends can be accessed from the terragrunt temp/cache dir for all modulesmock_outputs
in alldependency
stanzas.skip_outputs
in ANYdependency
stanzas.mock_outputs_allowed_terraform_commands = ["fmt", "validate"]
mock_outputs_merge_strategy_with_state = "deep_map_only"
"no_merge"
and"shallow"
to no avail...
terragrunt run-all validate
is still producing unresolveableUnsupported Argument
errors from terragrunt not recognizing the output name of a module declared elsewhere as a dependency, and in this example, specifically theavailability_zone_names
output ofmodules/region/data
, which has appropriate mocks defined.The full transcript of running the validate command with debug logging on is at my repo here.