https://pulumi.com logo
Title
b

brainy-policeman-17905

10/21/2020, 2:43 PM
I am sure I am missing something but I'm not really sure what that is šŸ˜ž
l

lemon-agent-27707

10/21/2020, 2:56 PM
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:
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

brainy-policeman-17905

10/21/2020, 3:37 PM
right, that makes sense now, thank you
c

calm-greece-42329

10/21/2020, 5:52 PM
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

lemon-agent-27707

10/21/2020, 6:10 PM
If you're just doing string formatting there are utility functions to help like pulumi.interpolate for node.
c

calm-greece-42329

10/21/2020, 6:43 PM
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.