https://pulumi.com logo
#getting-started
Title
# getting-started
s

stale-zoo-97300

06/27/2023, 4:40 PM
Hi everyone, new to pulumi , I want to programatically (c#) edit the main yaml file with yaml runtime (deserialize the stack from yaml into classes, modify data, add resources, etc, then save ), but looking at the automation API could not find a way. The GetProjectSettingsAsync for example just throws exception when finds runtime yaml. Am I missing some other APIs to do this ?
e

echoing-dinner-19531

06/28/2023, 11:17 AM
Just use a standard yaml library to do this, no need to use automation api.
s

stale-zoo-97300

06/28/2023, 12:57 PM
Thanks Fraser, was hoping the api presents both the stack state and the stack definition, but can parse the yaml file on disk, as you suggest.
e

echoing-dinner-19531

06/28/2023, 1:00 PM
YAML programs are an extension to the core project file specification so I don't think we'd ever extend automation api to cover that, would require trying to keep all the automation apis in sync with YAML and the intention is these different runtimes shouldn't need to care about each other.
s

stale-zoo-97300

06/28/2023, 1:01 PM
👍