re: above thread, something I've been trying to wo...
# python
re: above thread, something I've been trying to work my head around today is passing outputs into a jinja2 template
You will need to do that within the apply!
👀 1
If you have some example code I can maybe help point you in the right direction
I'm all set now, I was struggling originally because I was trying to do something like:
Copy code
test = '''{{ some_value }}'''
  some_value = pulumi_output.apply(lambda x: f"{x}"
and similar incantations, which was not working adjusting to treat the apply as the entrypoint e.g.
Copy code
test = '''{{ some_value }}'''
  lambda x: jinja2.Template(test).render(some_value=x))
works just fine 🙂
🎉 1
partypus 8bit 1
hey Rob, is there any reason you don't want to use
as the entrypoint? you have to do it that way, because
basically means "wait for this value to resolve, then do something"
no reason I was just misunderstanding how it worked
mentally it was just like: 1. I put
into the render call and my resulting string has the
value in it 2. Ok, I'll swap that to
, etc., trying to find one that works 3. Try to search examples repository, don't find anything great immediately, post in slack 🙂
My normal approach to this is to drop into a pdb session and start calling things interactively, but the Output objects are weird in that they just return other Output objects? I couldn't find a place to start debugging at where I could actually resolve them
will do thanks!
believe it or not I have no problem with promise.then(), for whatever reason the pulumi grammar just breaks my brain 🙂
Not only yours mate 🙂 I usually have the same approach when I'm learning a new tool. Just drop into the debugger and see what I can touch. I suspect this happens because Pulumi promises that you can use the language of your choice but after that, you discover that you may be writing the language but Pulumi dictates how you write it. I find it difficult to adjust as well. I also believe if this can be fixed it will unleash the true potential Pulumi has. However it will probably take some time