Closed 65156 closed 1 hour ago
I think it would make a lot more sense if at_cloud_logs_targets, and activity_tracker_routes, instead of consuming the modules own output, by default set these values inside at the resource or submodule level, or if instance id is external to the root module allowed this as input, however conditional logic should be used to differentiate if the root module is to deploy an instance or reference an already provisioned instance.
Worked with the consumer internally. Each submodule is available to be called on its own if needed: https://github.com/terraform-ibm-modules/terraform-ibm-observability-instances/tree/main/modules
However it is also possible to self reference resources, just like we do in the example: https://github.com/terraform-ibm-modules/terraform-ibm-observability-instances/blob/76577069900611729501d37489e263f21201cab6/examples/advanced/main.tf#L235
We are having some issues trying to utilize this module, I believe the problem is coming from the modules self reference.
Blame: https://github.com/terraform-ibm-modules/terraform-ibm-observability-instances/blame/main/examples/advanced/main.tf#L235-L236
Update: ok this seems to be an issue only when using this module in conjunction with a for_each or count as soon as you utilize the
at_cloud_logs_targets
block.our provisioning code was as follows