sparse-intern-71089
07/28/2021, 3:42 PMgreat-sunset-355
07/28/2021, 4:38 PMstack_name = 'jan/proj/core'
class MyZone(BaseModel):
zone_id: str
force_destroy: bool
async def fun():
ref_zone = pulumi.StackReference(stack_name)
print('lol')
result = await ref_zone.outputs.future()
print(result)
my_zone = MyZone.parse_obj(result['my_zone'])
print(my_zone)
# ... contiune creating my resources here
loop = asyncio.get_running_loop()
loop.create_task(fun())
@billowy-army-68599 maybe you'd know?billowy-army-68599
red-match-15116
07/28/2021, 4:46 PMdef create_ref_zone_pd(ref_zone):
return MyZone(**ref_zone)
my_zone_pd = ref_zone.require_output.apply(create_ref_zone_pd)
great-sunset-355
07/28/2021, 4:55 PMapply
because anything coming out of apply
is an Output
so I cannot use my_zone_pd.zone_id
red-match-15116
07/28/2021, 5:00 PMmy_zone_pd.zone_id
as an input to another resource?
Because you can use an Output
as an Input
(since Input
is the union of Output[T]
and T
)great-sunset-355
07/28/2021, 5:02 PMgreat-sunset-355
07/28/2021, 5:04 PMasync def fun():
ref_zone = pulumi.StackReference(stack_name)
print('lol')
result = await ref_zone.outputs.future()
print(result)
my_zone = MyZone.parse_obj(result['my_zone'])
print(my_zone)
ec2.SecurityGroup(
f"mhh{my_zone.zone_id}"
)
loop = asyncio.get_running_loop()
loop.create_task(fun())