Open SamuelMolling opened 1 year ago
@denis256 you can help me ?
Hi,
was attempted to define some dummy values in the mock_outputs
of the dependency?
https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#dependency
Yes, but it does not recover the dependency state and this causes problems in apply, causing it to keep dummy values.
I work with workspaces, as I mentioned earlier. But to retrieve the values of this dependency in my github action, I had to send a space in module 1's file for module 2 to retrieve the value. In this case, every change made by PR I was obliged to send an "alteration" in module 1
A workaround is to use a generated block to set a terraform block like this:
generate "terraform" {
path = "terraform.tg.tf"
if_exists = "overwrite_terragrunt"
contents = <<EOF
terraform {
cloud {
organization = "my-org"
workspaces {
name = "${workspace}"
}
}
}
EOF
}
Basically I have a module that depends on another module, but I use workspaces. When I run an init in gitactions it gives me the following error:
I searched in several forums and I couldn't solve it, because:
1 - When I run a run-all init, it says that the default workspace has no output. It's true because it only exists in the develop workspace
2 - When I try to switch the workspace first, I also get an error.
The problem is solved when I upload the file of module 1 (putting a space in the file) and module 2 in the same plan, then it finds the output. I tried to refresh first, but it gives an error that there is no resource in the default workspace.