https://pulumi.com logo
#typescript
Title
# typescript
s

steep-angle-29984

05/28/2020, 10:53 AM
If I perform an
apply()
on an
Output
of a resource, shouldn't the callback only be called when the resource is created and the value is available when doing a
pulumi preview
?
b

bland-telephone-59986

05/28/2020, 10:57 AM
From the docs for apply function - “This function will only be called execution of a ‘pulumi up’ request. It will not run during ‘pulumi preview’ (as the values of resources are of course not known then). It is not available for functions that end up executing in the cloud during runtime. To get the value of the Output during cloud runtime execution, use get().”
👍 1
s

steep-angle-29984

05/28/2020, 11:04 AM
Ok thanks, so I must have been doing something wrong here. I'm creating a
k8s.core.v1.Service
resource and calling apply on it's
metadata.name
property, which is an
Output
. If I run
pulumi preview
the callback gets called with
undefined
as value. Am I understanding something wrong here?
Sorry, forget it. I misused deepmerge somewhere in between which caused my problem.
2 Views