some-zoo-66319
04/28/2025, 12:26 PMinstance = gcp.compute.get_instance_output(name=name, zone=zone, opts=pulumi.InvokeOutputOptions(depends_on=[other_instance]))
I can't get it by using instance.current_status
, and I can't get it by using instance.current_status.apply(lambda current_status: current_status)
. In both cases, I'm getting the following error warning: Calling __str__ on an Output[T] is not supported.
Thank youlittle-cartoon-10569
04/28/2025, 8:19 PMsome-zoo-66319
04/29/2025, 6:07 AMdef wait_until_stopped(instance):
while True:
returned_instance = gcp.compute.get_instance_output(name=instance.name, zone=instance.zone, opts=pulumi.InvokeOutputOptions(depends_on=[instance]))
status = returned_instance.current_status.apply(lambda current_status: print(current_status))
if status == "TERMINATED":
break
but this doesn't work because status is a future value.
An alternative is to use the direct form of the function get_instance
, but then I can't use depends_on
with it.
How can I still use depends_on
while also accessing the values at the "top" level of my code?little-cartoon-10569
04/29/2025, 6:50 PM