Hello there! Just trying out to write a custom resource. How do I access a provider (e.g. postgresql) to get access to the hostname of the db cluster?
m
many-telephone-49025
12/06/2022, 2:12 PM
Hi Andreas,
Do you mean a custom component resource?
s
stocky-ocean-5511
12/06/2022, 2:18 PM
yes
I see the possibility to get the config postgresql:host but I guess that does not work in case a custom provider is provider.
and I see the the optionto call self.get_provider('postgresql') in the constructor but it always return None
m
many-telephone-49025
12/06/2022, 2:35 PM
Not 100% sure, maybe @limited-rainbow-51650 has some ideas
l
limited-rainbow-51650
12/06/2022, 2:37 PM
@stocky-ocean-5511 where do you currently get the hostname from to create the custom postgres provider?
s
stocky-ocean-5511
12/06/2022, 2:40 PM
I create a customer provider and provide it via opts down to the component. I just checked, that self.get_provider works with "postgresql::" with two colons