terragrunt: Unapplied dependency outputs error
Terraform v0.20.2
I’m following along with the documentation (https://github.com/gruntwork-io/terragrunt#unapplied-dependency-and-mock-outputs), but seem to keep running into the error:
Unsupported attribute; This object does not have an attribute named "platform".
I have a pretty straightforward configuration, using mock_outputs, mock_outputs_allowed_terraform_commands, and skip_outputs:
# hosting/terragrunt.hcl
terraform {
source = "${get_terragrunt_dir()}/../../../core/hosting/module"
}
dependency "platform" {
config_path = "../platform"
mock_outputs = {
api_gateway_name = "test_api_gateway_name"
}
mock_outputs_allowed_terraform_commands = ["validate", "plan"]
skip_outputs = true
}
inputs = {
api_gateway_name = dependency.platform.outputs.platform
}
Project structure:
root
├── hosting
│ └── terragrunt.hcl
├── platform
│ └── terragrunt.hcl
└── terragrunt.hcl
Is there something I’m missing?
Thanks
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (10 by maintainers)
@subhash-dream11 I think I have been the same issue as your. This the workflow :
Workaround => use mock_outputs_merge_with_state = true available since terragrunt v0.31.4
If you have
skip_outputs = true, then yes. However, if you remove that line, then it will only use themock_outputswhen there are no outputs upstream.Ah the issue is in this line:
You are basically telling
terragruntthat it can only use themock_outputsif it is runningterraform validate, but in the logs you were runningterraform plan, so it doesn’t read themock_outputs.You can resolve that particular error by adding
planto the list.