hundreds-gpu-71155
04/05/2024, 8:13 PMenvironment_variables
and secure_environment_variables
and I would like to automatically sort inputs into them based on if they're secretshundreds-gpu-71155
04/05/2024, 9:05 PMOutput.from_input(output.is_secret())
will let me get the secret valuehundreds-gpu-71155
04/05/2024, 9:05 PMdict[str, Input[str]]
to Output[tuple[dict[str, str], dict[str, str]]]
based on if they're secretshundreds-gpu-71155
04/05/2024, 9:06 PMadventurous-butcher-54166
04/06/2024, 12:54 AM.is_secret()
is that it's an Awaitable[bool]
so it will just return a Future which can't be evaluated synchronously – and is a bit misconceiving as doing something like this will always be evaluated on non-secrets:
if none_secret_output.is_secret():
print("This will always evaluate")
So the solution is to do the sorting inside an async function which can either be run explicitly in the Pulumi managed asyncio event loop or simply be passed to pulumi.Output.from_input
which will take care of that for you.
See a working example:
https://gist.github.com/olafurnielsen/ef143c50e1c5e1c57a9f0d187102cbf8adventurous-butcher-54166
04/06/2024, 12:56 AMhundreds-gpu-71155
04/09/2024, 5:26 PM