sparse-intern-71089
02/14/2023, 1:33 PMechoing-dinner-19531
02/14/2023, 1:50 PM• How do we call it in our stacks? The method is async.Ah 🤦 I'll raise an issue about that, all the other SDKs support async calls in the program but I don't think we have a great way to do this in python yet (short of the user nesting the whole program in an asyncio.run call)
How come our code needs to care if an output is secret or not?Because you may want to change behaviour based on it being secret or not, more importantly we didn't want people to inadvertently leak secret values because they just didn't think about that the values could be secrets.
echoing-dinner-19531
02/14/2023, 1:53 PMdry-keyboard-94795
02/14/2023, 2:01 PMdry-keyboard-94795
02/14/2023, 2:01 PM# config.py
def get_output_details(stack, name):
from pulumi.runtime.sync_await import _sync_await
d = _sync_await(
stack.get_output_details(name)
)
return d.value if d.value is not None else d.secret_value
echoing-dinner-19531
02/14/2023, 2:03 PMdry-keyboard-94795
02/14/2023, 2:04 PMdry-keyboard-94795
02/14/2023, 2:10 PMdef async_get_output_details(self, ...): ...
get_output_details = run_sync(async_get_output_details)
echoing-dinner-19531
02/14/2023, 2:14 PM