garden
garden copied to clipboard
Runtime variables from Terraform modules are not available to Terraform plugin calls for other Terraform modules.
Bug
Current Behavior
Terraform module 1: shared-infrastructure
, output: kms-key-id
.
Terraform module 2: specific-service
depends on shared-infrastructure
, variable kms_key_id
: ${runtime.services.shared-infrastructure.outputs.kms_key_id}
.
This will fail during garden plugins terraform apply-module -- specific-service
with no valid value for kms_key_id
(${runtime.services.shared-infrastructure.outputs.kms_key_id}
is the actual value saved in tfvars), presumably because when calling the module with the plugin, it doesn't have the context of the other previously-run module.
Expected behavior
I would expect the output of the previous module to be available to the next module.
Reproducible example
(see above, but if required I can put together a simple example)
Workaround
The only workaround I can determine is to ensure that all required resources are within a single Terraform module, but this becomes pretty messy quickly.
Suggested solution(s)
Maybe determine outputs from dependent TF modules during the plugin run?
Additional context
Your environment
- OS: Ubuntu 20.04 LTS
- How I'm running Kubernetes: Kind
garden version
: 0.12.40
Thanks for pointing this out!
To speed up our debugging and fixing this issue, could you maybe provide us with a simple example project where this problem occurs?
Sure, I'll try to find time to put one together.
This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!
This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!
This issue has been automatically marked as stale because it hasn't had any activity in 90 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!
This was fixed in 0.13. Please let us know if it's still an issue.