strong-winter-28568
12/19/2022, 12:47 PMconst ip = frontend.status.loadBalancer.apply(
(lb) => lb.ingress[0].ip || lb.ingress[0].hostname
);
I am trying to use this IP in a client (Browser) application configuration. But I am not able to convert it into a string . I tried different methods including
ip.apply(i => `http://${i}/abc`)
Second
pulumi.interpolate `http://${ip}/abc`
Third
pulumi.concat(`http://`, ip, `/abc`)
Every time I get the same error, toString()
is not supported, or toJSON()
is not supported. Can someone help me please ?ancient-policeman-24615
12/19/2022, 1:46 PMOutput<string>
, and you can’t call toString()
or toJSON()
on outputs. Output<T>
is are similar to a promise, in that it represents a value that might not be present. Because an Output<T>
might not ever resolve (for example, during pulumi preview
), it can’t be awaited. You need to put whatever needs a raw string
inside an apply
.