https://pulumi.com logo
#general
Title
# general
t

thousands-balloon-4359

07/26/2023, 11:23 PM
Hey guys - had a quick question. Has there been some prior work around converting an existing pulumi yaml to say, generate python code?
m

miniature-musician-31262

07/26/2023, 11:26 PM
t

thousands-balloon-4359

07/26/2023, 11:27 PM
beautiful - so if you have YAML, you can go to any language
m

miniature-musician-31262

07/26/2023, 11:27 PM
From the blog:
Copy code
pulumi convert --language python
"This generates a Python program defining the exact same resources, along with all required dependencies."
Yep
t

thousands-balloon-4359

07/26/2023, 11:27 PM
so if i have python code, i wouldn't be able to take it to YAML but i could go the other way
which makes sense tbh
m

miniature-musician-31262

07/26/2023, 11:28 PM
You may hit little issues -- for example, it may not generate the most perfectly idiomatic Python code, etc. But it should generate a valid program in any supported language.
Correct -- YAML to anything, but not the other way 'round .. yet. 🙂
t

thousands-balloon-4359

07/26/2023, 11:29 PM
ty so much, @miniature-musician-31262
@miniature-musician-31262 is there some work-in-progress or sentiment/interest towards enabling python/js/etc to YAML?
essentially, something like that would enable going from one language to another (using YAML as the intermediary)
which would be quite cool
m

miniature-musician-31262

07/26/2023, 11:52 PM
Definitely yes -- let me see if I can dig up an issue, as I think there may already be one.
t

thousands-balloon-4359

07/26/2023, 11:53 PM
super helpful
this is perhaps the only related one i can see? https://github.com/pulumi/pulumi/issues/12720
m

miniature-musician-31262

07/27/2023, 12:50 AM
Yeah I think you're right; that's all I was able to find also.
Would you be up for filing an issue on pulumi/pulumi for it? If not I'd be happy to.
e

echoing-dinner-19531

07/27/2023, 8:05 AM
There's a similar issue at https://github.com/pulumi/pulumi/issues/4271. I would say it's incredibly unlikely that we would do a conversion from TS/Python/etc to YAML or anything else. It's likely just far far too difficult in general to be able to parse and convert a general programming language to another one. I've got an idea which might allow us to do the most basic programs (a program that doesn't use an Apply methods), but it's a lot of work for not a very clear benefit.