I am sure I am missing something but I'm not reall...
# typescript
b
I am sure I am missing something but I'm not really sure what that is 😞
l
So the problem here is that
.apply
returns another output (an async promise-like future). You'll have to log within the apply if you want to capture the raw value:
Copy code
x.apply( val => console.log(val))
Note that applies are not guaranteed to run during preview, so you may only see this during update.
b
right, that makes sense now, thank you
c
this is helpful and i think should be documented somewhere or something. ive had a lot of problems trying to get the “output” of an output and just getting more outputs 🙂
is there something like apply that does return the raw value? i need to generate a rendered json string that includes misc ARNs. i know i can do a .all/.apply (as seen in https://www.pulumi.com/blog/intro-to-step-functions/) but that is pretty gross as the function gets longer and more complicated
l
If you're just doing string formatting there are utility functions to help like pulumi.interpolate for node.
c
im not though. im trying to create something like the apigateway in awsx for step functions. so, i’d like to have objects to reflect the unique stages (there are a lot of these) that finally render down into a json string. the challenge is that there would be ARNs and things deep in there
im trying to do something like this now: assembling the statemachine resource & a _render function
sfn.StateMachineArgs.definition is the json string that is partially assembled from _render’s on the states.