Hey i have this code ```public_subnets = dis_stack...
# python
e
Hey i have this code
Copy code
public_subnets = dis_stack.get_output("public_subnets")

subnets_list = public_subnets.apply(lambda id: id)
but it returns an output object, how can i do that i get a list ?
f
you can't, it's like working with futures. You can use the output in an apply, but you can't just get the actual value. What are you trying to accomplish?
e
passing the subnets list to an ELB resource as input
f
Can't you just pass it as is (wrapped in an Output) to the ELB resource?
e
1 min ill send you the error i ge
t
Copy code
AssertionError: Unexpected type. Expected 'list' got '<class 'str'>'
but when i print the type of the public_subnets i get this
Copy code
print(type(public_subnets))
<class 'pulumi.output.Output'>
f
So Output is a wrapper object. I think the issue might be that you have an Output[Str] when you want an Output[List[str]]
you could maybe try adding some debugging/print statements in the apply lambda to see what the actual value is
e
the output is an output from another stack that i exported it like this
Copy code
pulumi.export("public_subnets", public_subnets.ids)
f
I'm not sure how output serialization/deserialization works
p
if you stop with a break point inside the applys lambda you will have a string. because that runs inside pulumi engine.
e
i dont understand @powerful-lunch-15492
how ?
p
check this
Copy code
pritunl_output = instance.public_ip.apply(
            lambda public_ip: {
                "host": f"https://{public_ip}",
            },
        )
pulumi.export("pritunl-data", pritunl_output)
instace is an ec2 instace
Copy code
import ipdb
clusters = aws.eks.get_clusters()
def method(args):
    ipdb.set_trace()
    print(args)

pulumi.Output.all(clusters).apply(
    lambda args: method(args),
)
for example
e
umm, nvm guys i figured it out thanks any way
👍 1