sparse-intern-71089
01/29/2021, 1:59 AMbillowy-army-68599
nlb_name
but you're setting the name of the created loadbalancer to stacktname + "-lb"
billowy-army-68599
billowy-army-68599
billowy-army-68599
billowy-army-68599
sts get-caller-identity
callbillowy-army-68599
describe_load_balancers
inside an apply
billowy-army-68599
alert-raincoat-81485
01/29/2021, 2:26 AMalert-raincoat-81485
01/29/2021, 2:27 AMalert-raincoat-81485
01/29/2021, 2:27 AMalert-raincoat-81485
01/29/2021, 2:28 AMalert-raincoat-81485
01/29/2021, 2:29 AMbillowy-army-68599
billowy-army-68599
Output
. Output's are like a python coroutine, you need to wait until they're finished before you do the describealert-raincoat-81485
01/29/2021, 2:56 AMalert-raincoat-81485
01/29/2021, 2:56 AMalert-raincoat-81485
01/29/2021, 2:59 AMOutput
. Output’s are like a python coroutine, you need to wait until they’re finished before you do the describe”
And this is what i am looking for, if i can apply something like async or wait function in it.billowy-army-68599
alert-raincoat-81485
01/29/2021, 3:07 AMalert-raincoat-81485
01/29/2021, 3:08 AMalert-raincoat-81485
01/29/2021, 3:15 AMloadbalancer.arn
output is coming in form of <pulumi.output.Output object at 0x1075c4430>
but not actual a string.billowy-army-68599
Output[str]
, so as I said before, you need to do that in an apply. You don't need to use boto3 at all. give me a few minutesalert-raincoat-81485
01/29/2021, 3:24 AMbillowy-army-68599
def write_to_file(arn):
f = open("arn.txt", "a")
f.write(arn)
f.close()
# anything that is run inside an apply runs only when the resource has finished
# creating and has returned the value you're applying, in this case, the arn
json = lb.arn.apply(lambda a: write_to_file(arn=a))
billowy-army-68599
write_to_file
only after the actual resource has been created and the API has returned a value to you. That's what apply doesbillowy-army-68599
alert-raincoat-81485
01/29/2021, 3:35 AMquiet-leather-94755
01/30/2021, 8:02 AMquiet-leather-94755
01/30/2021, 8:06 AMloadbalancer.arn
, you have to pass your action as a lambda that Pulumi can run once the resource referenced by the Output has been deployed / updated.