bland-lamp-16797
04/22/2020, 4:51 PMdns_name
of pulumi_gcp.dns.ManagedZone
is class pulumi.output.Output
and how to convert it to str()
so I can use it laterlemon-agent-27707
04/22/2020, 5:00 PMOutput
are not known at runtime. They become eventually available as cloud resources are created. Because of this, you need to use .Apply()
to execute callbacks when those resources become available.
.Apply()
creates a new asynchronous future that can be passed as input to another cloud resource. For instance you can create a VPC, and it will have a subnetID output that can be passed as input to create an EC2 instance or virtual machine.bland-lamp-16797
04/23/2020, 6:47 AMterraform console
or ipython
?
Here is good ex:
lets say I have this decliration
`
b81_zone = dns.ManagedZone("b81-root", description="Root of b81.dev", dns_name="b81.dev.", labels={"managed_by": "pulumi"})
and I want to use b81_zone.dns_name
but I simply can't get it 😞
The closest that I got is
`
b81_zone.dns_name.apply(lambda dns_name: dns_name)
but it still returns Output class. I just need a terminal or a way to debug this classlemon-agent-27707
04/23/2020, 8:07 AM.Apply
calls.bland-lamp-16797
04/23/2020, 9:17 AMprint(b81_zone.dns_name.apply(lambda foo: f"{foo}"))
is not working 😞b81_zone.dns_name.apply(lambda c: print(c))