I’ve created an ElasticSearch cluster in Pulumi. W...
# general
s
I’ve created an ElasticSearch cluster in Pulumi. What’s the right way to use the
endpoint
it outputs in the config files I generate for downstream resources? To get that value as a string, do I put the whole downstream resource inside the output’s
apply()
?
w
The typical approach is to do something like
prop: r.endpoint.apply(e => transform(e))
That is, use
apply
to compute the value to pass as an input to some resource, instead of creating the resource itself within the
apply
.
s
Ah, so I can use these transformed `Output`s in place of string parameters in my resources?
Yep, that worked. Thanks!
w
Yes - all inputs to resources are
Input<T>
which accepts a T or an Output<T>.