I have a configuration whereby multiple stacks are wired together using the technique as specified on the Deploy Multiple Stacks page.
The stacks seem to deploy successfully when issuing a terraspace all up, however when a terraspace all plan is issued a number of errors are encountered, for example:
│ Error: Invalid value for input variable
│
│ on 2-base.auto.tfvars line 13:
│ 13: private_subnet_ids = "(Output private_subnet_ids was not found for the eks-cluster tfvars file. Either htp-config stack has not been deployed yet or it does not have this output: private_subnet_ids. Also, if local backend is being used and has been removed/cleaned, then it will also result zero-byte state.json with the 'terraform state pull' used to download the terraform state and output will not be found.)"
│
Everything appears to check out as the stacks all deploy fine when doing an all up command.
There are also a few “undeclared variable” errors which creep in, but again these all check out when walking through the module and stack dependencies.
Think will change the behavior so it returns a null value instead of the string. It’ll just log the warning. Unsure when will get to it. Will get to it though. Will consider PRs. Of course no sweat either way
So made no real progress with this. The issue is partly made worse when the ERB output call returns the error as a string, and this can cause issues when the expectant variable type is say a map or a list.
it would be much better if the fucntion somehow returned the equivalent of null so this could be catered for with Terrarform default values and nullable = false
And getting Ruby to return anything like the correct type is just an ugly hack I’d rather not go down.
Yup. Agree with this. The output helper should return null instead of a String. Hope to get to it in the next major release of Terraspace. Been working on terraspace more lately but it might still a while off.
This has also caused me issues.
We are using Github actions deployment pipeline which produces plans on PR and deploys on merge. We like the idea of using terraspace to build multiple environments but this does hinder things somewhat in that we have to bypass pipeline on environment launch or certain additions that involve cross stack references
OK, mock values is actually very useful and apologies, I should have read the documentation before posting the above.
It has not completed unblocked me unfortunately since I am referencing a AWS secret in a data object which terraform trys to resolve on plan and as such the secret does actually need to exist. But this is simply my particular use case which doesn’t play well with this feature.