Hello, using the automation API (in Python) I want...
# getting-started
b
Hello, using the automation API (in Python) I want to use the stack state as the source of truth for a Pulumi program. How can I turn the stack state (the json file produced by ´pulumi refresh´) into a Pulumi program? In other words, I want to programmatically bring the infrastructure state back to what is described in the stack state (say after manual changes). I’ve been scouring the documentation and the Python SDK without success so far. Do you have any tips?
👍 1
e
There isn't enough information in the state file to reconstruct the program that created it
b
Thanks for the quick reply. I might have to rethink my plan then. Is there more documentation about the YAML source and target languages of the ´pulumi convert´ command, please? https://www.pulumi.com/docs/iac/cli/commands/pulumi_convert/
e
I'm not sure what more documentation your after? The docs list what sources and targets are supported, if you want to add a new one you'd have to write a
converter
plugin (source) or
language
plugin (target).
b
Thanks, I meant the output/input YAML format.
e
If the input is yaml then it's a pulumi yaml program: https://www.pulumi.com/docs/iac/languages-sdks/yaml/yaml-language-reference/
blog post introducing that from last year: https://www.pulumi.com/blog/pulumi-yaml/
b
Thank you very much