adamant-eye-17419
11/28/2024, 2:32 PMT = TypeVar("T")
def resolve(v: T | pulumi.Output[T]) -> T:
if not isinstance(v, pulumi.Output):
return v
else:
return v.apply(lambda x: x)
that I use on all inputs. But that is kinda tedious and at the same time seems like something that should exist in the library as I'm under the impression that this is not an uncommon use case.late-window-4903
11/28/2024, 4:29 PMadamant-eye-17419
11/28/2024, 7:45 PMplain = None
def fn(vv):
nonlocal plain
plain = v
v.apply(fn)
return plain
adamant-eye-17419
11/28/2024, 7:49 PMOutput
? Isn't that getting me the opposite of what I need?adamant-eye-17419
11/28/2024, 7:50 PMlate-window-4903
11/28/2024, 9:26 PMNone
, since the callback wont be triggered until the output v
resolves in the future.late-window-4903
11/28/2024, 9:28 PMlate-window-4903
11/28/2024, 9:29 PMadamant-eye-17419
11/28/2024, 9:38 PMa = FooResource()
b = BarResource(foo_id=a.id)
c = BarResource(foo_id=12345)
Here BarResource
needs to be able to handle outputs as well as plain values at the same timeadamant-eye-17419
11/28/2024, 9:38 PMb
can only be created when a.id
is resolved